From: franck.jullien@gmail.com
To: barebox@lists.infradead.org
Subject: [PATCH] spi: unregister dev if master->setup fails
Date: Wed, 6 Jul 2011 00:14:49 +0200 [thread overview]
Message-ID: <1309904090-9100-2-git-send-email-franck.jullien@gmail.com> (raw)
In-Reply-To: <1309904090-9100-1-git-send-email-franck.jullien@gmail.com>
From: Franck Jullien <franck.jullien@gmail.com>
If the device setup executed by the spi master fails,
unregister the created device.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
drivers/spi/spi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6456897..aefb916 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -91,6 +91,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
return proxy;
fail:
+ unregister_device(&proxy->dev);
free(proxy);
return NULL;
}
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-07-05 22:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 22:14 [PATCH] spi: add bits_per_word to proxy structure franck.jullien
2011-07-05 22:14 ` franck.jullien [this message]
2011-07-05 22:14 ` [PATCH] Nios2: Compile bootm only if needed franck.jullien
2011-07-06 8:26 ` [PATCH] spi: add bits_per_word to proxy structure Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309904090-9100-2-git-send-email-franck.jullien@gmail.com \
--to=franck.jullien@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox