aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLukasz Gemborowski <lukasz.gemborowski@nokia.com>2016-06-27 12:57:47 +0200
committerWolfram Sang <wsa@the-dreams.de>2016-07-06 00:33:49 +0900
commit22ebf00eb56fe77922de8138aa9af9996582c2b3 (patch)
tree04bfdbabe11d51fb2c02bc2f293f65d67d93d0fb /drivers/i2c
parenti2c: tegra: Correct error path in probe (diff)
downloadlinux-dev-22ebf00eb56fe77922de8138aa9af9996582c2b3.tar.xz
linux-dev-22ebf00eb56fe77922de8138aa9af9996582c2b3.zip
i2c: mux: reg: wrong condition checked for of_address_to_resource return value
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> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/muxes/i2c-mux-reg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index 26e7c5187a58..c6a90b4a9c62 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) == 0) {
mux->data.reg_size = resource_size(&res);
mux->data.reg = devm_ioremap_resource(&pdev->dev, &res);
if (IS_ERR(mux->data.reg))