Commit 21793d22 authored by Basavaraj Natikar's avatar Basavaraj Natikar Committed by Linus Walleij

pinctrl: amd: Use devm_platform_get_and_ioremap_resource

Use devm_platform_get_and_ioremap_resource() to simplify code.
Signed-off-by: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Link: https://lore.kernel.org/r/20220613064127.220416-2-Basavaraj.Natikar@amd.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5495d163
......@@ -1079,17 +1079,12 @@ static int amd_gpio_probe(struct platform_device *pdev)
raw_spin_lock_init(&gpio_dev->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
gpio_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(gpio_dev->base)) {
dev_err(&pdev->dev, "Failed to get gpio io resource.\n");
return -EINVAL;
return PTR_ERR(gpio_dev->base);
}
gpio_dev->base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!gpio_dev->base)
return -ENOMEM;
gpio_dev->irq = platform_get_irq(pdev, 0);
if (gpio_dev->irq < 0)
return gpio_dev->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