irqchip/irq-mvebu-pic: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210908105701.1678-1-caihuoqing@baidu.com
This commit is contained in:
Cai Huoqing 2021-09-08 18:57:00 +08:00 committed by Marc Zyngier
parent 0c1479a663
commit bacdbd710d
1 changed files with 1 additions and 3 deletions

View File

@ -121,14 +121,12 @@ static int mvebu_pic_probe(struct platform_device *pdev)
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct mvebu_pic *pic; struct mvebu_pic *pic;
struct irq_chip *irq_chip; struct irq_chip *irq_chip;
struct resource *res;
pic = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pic), GFP_KERNEL); pic = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pic), GFP_KERNEL);
if (!pic) if (!pic)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pic->base = devm_platform_ioremap_resource(pdev, 0);
pic->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pic->base)) if (IS_ERR(pic->base))
return PTR_ERR(pic->base); return PTR_ERR(pic->base);