linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-mux-reg: wrong condition checked for of_address_to_resource return value
@ 2016-06-27  9:21 Lukasz Gemborowski
  2016-06-27  9:26 ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Gemborowski @ 2016-06-27  9:21 UTC (permalink / raw)
  To: wsa, peda, linux-i2c; +Cc: alexander.sverdlin

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

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

end of thread, other threads:[~2016-07-05 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27  9:21 [PATCH] i2c: i2c-mux-reg: wrong condition checked for of_address_to_resource return value Lukasz Gemborowski
2016-06-27  9:26 ` Wolfram Sang
2016-06-27 10:57   ` [PATCH v2] " Lukasz Gemborowski
2016-07-05 15:32     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).