pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code
Subsystems (4)
PATCH 1/1 pinctrl: freescale: 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 Anson Huang <[email protected]>
--- drivers/pinctrl/freescale/pinctrl-imx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/freescale/pinctrl-imx.c +1 -3
@@ -785,7 +785,6 @@ int imx_pinctrl_probe(struct platform_device *pdev,struct pinctrl_desc *imx_pinctrl_desc;struct device_node *np;struct imx_pinctrl *ipctl; -struct resource *res;struct regmap *gpr;int ret, i;
@@ -817,8 +816,7 @@ int imx_pinctrl_probe(struct platform_device *pdev, ipctl->pin_regs[i].conf_reg =-1 ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - ipctl->base =devm_ioremap_resource (&pdev->dev, res); + ipctl->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (ipctl->base))return PTR_ERR (ipctl->base);
Signature · 1 line
2.7.4
Quoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Reviewed-by Mukesh Ojha <[email protected]>
Cheers,
-Mukesh
Quoted 26 lines
--- drivers/pinctrl/freescale/pinctrl-imx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/pinctrl/freescale/pinctrl-imx.c +1
-3@@ -785,7 +785,6 @@ int imx_pinctrl_probe(struct platform_device *pdev,struct pinctrl_desc *imx_pinctrl_desc;struct device_node *np;struct imx_pinctrl *ipctl; -struct resource *res;struct regmap *gpr;int ret, i;@@ -817,8 +816,7 @@ int imx_pinctrl_probe(struct platform_device *pdev, ipctl->pin_regs[i].conf_reg =-1 ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - ipctl->base =devm_ioremap_resource (&pdev->dev, res); + ipctl->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (ipctl->base))return PTR_ERR (ipctl->base);
Quoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Patch applied.
Yours,
Linus Walleij