From: Wei Yongjun Date: Mon, 27 Apr 2020 11:08:29 +0000 (+0000) Subject: gpio: mlxbf2: fix return value check in mlxbf2_gpio_get_lock_res() X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~2017^2~27 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=66d8ad67aab3bc6f55e7de81565cd0d4875bd851;p=linux.git gpio: mlxbf2: fix return value check in mlxbf2_gpio_get_lock_res() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200427110829.154785-1-weiyongjun1@huawei.com Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 240b488609ac..fca6a50d9308 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -109,8 +109,8 @@ static int mlxbf2_gpio_get_lock_res(struct platform_device *pdev) } yu_arm_gpio_lock_param.io = devm_ioremap(dev, res->start, size); - if (IS_ERR(yu_arm_gpio_lock_param.io)) - ret = PTR_ERR(yu_arm_gpio_lock_param.io); + if (!yu_arm_gpio_lock_param.io) + ret = -ENOMEM; exit: mutex_unlock(yu_arm_gpio_lock_param.lock);