diff options
author | Lukasz Gemborowski <lukasz.gemborowski@nokia.com> | 2016-06-27 13:57:47 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-07-05 18:33:49 +0300 |
commit | 22ebf00eb56fe77922de8138aa9af9996582c2b3 (patch) | |
tree | 04bfdbabe11d51fb2c02bc2f293f65d67d93d0fb /drivers/i2c/muxes/i2c-mux-reg.c | |
parent | eab09988e47f2b4322faa5ee1430d05714e59000 (diff) | |
download | linux-22ebf00eb56fe77922de8138aa9af9996582c2b3.tar.xz |
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/muxes/i2c-mux-reg.c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-reg.c | 2 |
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)) |