All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Gemborowski <lukasz.gemborowski@nokia.com>
To: wsa@the-dreams.de, peda@axentia.se, linux-i2c@vger.kernel.org
Cc: alexander.sverdlin@nokia.com
Subject: [PATCH] i2c: i2c-mux-reg: wrong condition checked for of_address_to_resource return value
Date: Mon, 27 Jun 2016 11:21:48 +0200	[thread overview]
Message-ID: <20160627092144.GA20023@nokia.com> (raw)

of_address_to_resource return 0 on successful call but
devm_ioremap_resource is called only if it returns non-zero value

Signed-off-by: Lukasz Gemborowski <lukasz.gemborowski@nokia.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 drivers/i2c/muxes/i2c-mux-reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index 26e7c51..012a7ab 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -145,7 +145,7 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
 		mux->data.idle_in_use = true;
 
 	/* map address from "reg" if exists */
-	if (of_address_to_resource(np, 0, &res)) {
+	if (!of_address_to_resource(np, 0, &res)) {
 		mux->data.reg_size = resource_size(&res);
 		mux->data.reg = devm_ioremap_resource(&pdev->dev, &res);
 		if (IS_ERR(mux->data.reg))
-- 
2.5.0

             reply	other threads:[~2016-06-27 10:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27  9:21 Lukasz Gemborowski [this message]
2016-06-27  9:26 ` [PATCH] i2c: i2c-mux-reg: wrong condition checked for of_address_to_resource return value Wolfram Sang
2016-06-27 10:57   ` [PATCH v2] " Lukasz Gemborowski
2016-07-05 15:32     ` Wolfram Sang

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=20160627092144.GA20023@nokia.com \
    --to=lukasz.gemborowski@nokia.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.