mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
To: barebox@lists.infradead.org
Cc: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
Subject: [PATCH] drivers: smc911x fix inverted wait_on_timeout
Date: Fri, 29 Jan 2021 12:44:35 -0500	[thread overview]
Message-ID: <20210129174435.17699-1-michael.nawrocki@gtri.gatech.edu> (raw)

The smc911x driver probe routine polls the READY bit using
wait_on_timeout, which returns 0 on success. The error check following
the wait_on_timeout invocation in the probe routine interprets a
returned 0 as failure.

This patch correctly interprets the return value of wait_on_timeout.

Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
---
 drivers/net/smc911x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index ea7cea5f1..1edc16ce4 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -541,7 +541,7 @@ static int smc911x_probe(struct device_d *dev)
 	 * forbidden while this bit isn't set. Try for 100ms
 	 */
 	ret = wait_on_timeout(100 * MSECOND, smc911x_reg_read(priv, PMT_CTRL) & PMT_CTRL_READY);
-	if (!ret) {
+	if (ret) {
 		dev_err(dev, "Device not READY in 100ms aborting\n");
 		return -ENODEV;
 	}
-- 
2.20.1


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

             reply	other threads:[~2021-01-29 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 17:44 Mike Nawrocki [this message]
2021-01-31 19:38 ` Ahmad Fatoum
2021-02-01  8:32 ` 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=20210129174435.17699-1-michael.nawrocki@gtri.gatech.edu \
    --to=michael.nawrocki@gtri.gatech.edu \
    --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