diff options
author | Lukasz Gemborowski <lukasz.gemborowski@nokia.com> | 2016-06-27 12:57:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-10 12:54:49 +0200 |
commit | ed87c21407e4d781dc88c4b4fce0113336ba501d (patch) | |
tree | f60cc173d3604d345b880298dc730ea843539a00 | |
parent | f5be1dff829038ff2225238291c67fdeb7caa0c9 (diff) | |
download | lwn-ed87c21407e4d781dc88c4b4fce0113336ba501d.tar.gz lwn-ed87c21407e4d781dc88c4b4fce0113336ba501d.zip |
i2c: mux: reg: wrong condition checked for of_address_to_resource return value
commit 22ebf00eb56fe77922de8138aa9af9996582c2b3 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 5fbd5bd0878f..49fc2c7e560a 100644 --- a/drivers/i2c/muxes/i2c-mux-reg.c +++ b/drivers/i2c/muxes/i2c-mux-reg.c @@ -150,7 +150,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)) |