mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: core: Check return value of dev_add_param_bool
@ 2015-03-18 14:13 Wadim Egorov
  2015-03-19  6:52 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Wadim Egorov @ 2015-03-18 14:13 UTC (permalink / raw)
  To: barebox

Commit 03b59bdb64e83ebcdb9111681775117ebce0e03b changed the
return values of dev_add_param_* to ERR_PTR(-ENOSYS) and broke a few boards.
We have now to care about the return value of dev_add_param_bool() in
mci_register().

Also set the ret variable when dev_add_param_bool() fails.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
 drivers/mci/mci-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 8221632..bd5cae2 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1774,7 +1774,8 @@ int mci_register(struct mci_host *host)
 	mci->param_probe = dev_add_param_bool(&mci->dev, "probe",
 			mci_set_probe, NULL, &mci->probe, mci);
 
-	if (IS_ERR(mci->param_probe)) {
+	if (IS_ERR(mci->param_probe) && PTR_ERR(mci->param_probe) != -ENOSYS) {
+		ret = PTR_ERR(mci->param_probe);
 		dev_dbg(&mci->dev, "Failed to add 'probe' parameter to the MCI device\n");
 		goto err_unregister;
 	}
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mci: core: Check return value of dev_add_param_bool
  2015-03-18 14:13 [PATCH] mci: core: Check return value of dev_add_param_bool Wadim Egorov
@ 2015-03-19  6:52 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-03-19  6:52 UTC (permalink / raw)
  To: Wadim Egorov; +Cc: barebox

On Wed, Mar 18, 2015 at 03:13:42PM +0100, Wadim Egorov wrote:
> Commit 03b59bdb64e83ebcdb9111681775117ebce0e03b changed the
> return values of dev_add_param_* to ERR_PTR(-ENOSYS) and broke a few boards.
> We have now to care about the return value of dev_add_param_bool() in
> mci_register().
> 
> Also set the ret variable when dev_add_param_bool() fails.
> 
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
>  drivers/mci/mci-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-19  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 14:13 [PATCH] mci: core: Check return value of dev_add_param_bool Wadim Egorov
2015-03-19  6:52 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox