mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Wadim Egorov <w.egorov@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] mci: core: Check return value of dev_add_param_bool
Date: Wed, 18 Mar 2015 15:13:42 +0100	[thread overview]
Message-ID: <1426688022-13679-1-git-send-email-w.egorov@phytec.de> (raw)

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

             reply	other threads:[~2015-03-18 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 14:13 Wadim Egorov [this message]
2015-03-19  6:52 ` 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=1426688022-13679-1-git-send-email-w.egorov@phytec.de \
    --to=w.egorov@phytec.de \
    --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