mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
i2c: mux: reg: wrong condition checked for of_address_to_resource return value
commit 22ebf00eb5 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
470f47fcf2
commit
1b0b5ca8f4
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user