Commit 358b9d24 authored by Anson Huang's avatar Anson Huang Committed by Marc Zyngier

irqchip/imx-irqsteer: Use devm_platform_ioremap_resource() to simplify code

Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent a7c90f51
...@@ -144,7 +144,6 @@ static int imx_irqsteer_probe(struct platform_device *pdev) ...@@ -144,7 +144,6 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct irqsteer_data *data; struct irqsteer_data *data;
struct resource *res;
u32 irqs_num; u32 irqs_num;
int i, ret; int i, ret;
...@@ -152,8 +151,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev) ...@@ -152,8 +151,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->regs = devm_platform_ioremap_resource(pdev, 0);
data->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(data->regs)) { if (IS_ERR(data->regs)) {
dev_err(&pdev->dev, "failed to initialize reg\n"); dev_err(&pdev->dev, "failed to initialize reg\n");
return PTR_ERR(data->regs); return PTR_ERR(data->regs);
......
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