Commit 9a6774ab authored by Lukasz Gemborowski's avatar Lukasz Gemborowski Committed by Stefan Bader

i2c: mux: reg: wrong condition checked for of_address_to_resource return value

BugLink: http://bugs.launchpad.net/bugs/1611833

commit 22ebf00e 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: default avatarLukasz Gemborowski <lukasz.gemborowski@nokia.com>
Reviewed-by: default avatarAlexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 5172a7c8
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment