Skip to content

Commit ab2e5c8

Browse files
Yang YingliangAndi Shyti
authored andcommitted
i2c: muxes: Fix return value check in mule_i2c_mux_probe()
If dev_get_regmap() fails, it returns NULL pointer not ERR_PTR(), replace IS_ERR() with NULL pointer check, and return -ENODEV. Fixes: d0f8e97 ("i2c: muxes: add support for tsd,mule-i2c multiplexer") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 59b723c commit ab2e5c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2c/muxes/i2c-mux-mule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ static int mule_i2c_mux_probe(struct platform_device *pdev)
6666
priv = i2c_mux_priv(muxc);
6767

6868
priv->regmap = dev_get_regmap(mux_dev->parent, NULL);
69-
if (IS_ERR(priv->regmap))
70-
return dev_err_probe(mux_dev, PTR_ERR(priv->regmap),
69+
if (!priv->regmap)
70+
return dev_err_probe(mux_dev, -ENODEV,
7171
"No parent i2c register map\n");
7272

7373
platform_set_drvdata(pdev, muxc);

0 commit comments

Comments
 (0)