diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2024-10-26 11:09:42 +0800 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-11-05 15:17:34 +0100 |
commit | ab2e5c8ff253ff612f7c6ef9441d2ff6558e5449 (patch) | |
tree | c5311fe99d9d40b2da0b9030ae4df4bd884a4157 /drivers/i2c | |
parent | 59b723cd2adbac2a34fc8e12c74ae26ae45bf230 (diff) |
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: d0f8e97866bf ("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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-mule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-mule.c b/drivers/i2c/muxes/i2c-mux-mule.c index 8e942470b35f..284ff4afeeac 100644 --- a/drivers/i2c/muxes/i2c-mux-mule.c +++ b/drivers/i2c/muxes/i2c-mux-mule.c @@ -66,8 +66,8 @@ static int mule_i2c_mux_probe(struct platform_device *pdev) priv = i2c_mux_priv(muxc); priv->regmap = dev_get_regmap(mux_dev->parent, NULL); - if (IS_ERR(priv->regmap)) - return dev_err_probe(mux_dev, PTR_ERR(priv->regmap), + if (!priv->regmap) + return dev_err_probe(mux_dev, -ENODEV, "No parent i2c register map\n"); platform_set_drvdata(pdev, muxc); |