Commit 622096fd authored by Wei Yongjun's avatar Wei Yongjun Committed by Bartosz Golaszewski

gpio: idt3243x: Fix return value check in idt_gpio_probe()

In case of error, the function devm_platform_ioremap_resource_byname()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: 4195926a ("gpio: Add support for IDT 79RC3243x GPIO controller")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 354cb646
......@@ -142,8 +142,8 @@ static int idt_gpio_probe(struct platform_device *pdev)
return -ENOMEM;
ctrl->gpio = devm_platform_ioremap_resource_byname(pdev, "gpio");
if (!ctrl->gpio)
return -ENOMEM;
if (IS_ERR(ctrl->gpio))
return PTR_ERR(ctrl->gpio);
ctrl->gc.parent = dev;
......@@ -160,8 +160,8 @@ static int idt_gpio_probe(struct platform_device *pdev)
if (device_property_read_bool(dev, "interrupt-controller")) {
ctrl->pic = devm_platform_ioremap_resource_byname(pdev, "pic");
if (!ctrl->pic)
return -ENOMEM;
if (IS_ERR(ctrl->pic))
return PTR_ERR(ctrl->pic);
parent_irq = platform_get_irq(pdev, 0);
if (!parent_irq)
......
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