ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
PATCH 1/1 ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle.
--- drivers/char/ipmi/bt-bmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/char/ipmi/bt-bmc.c +1 -3
@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev) bt_bmc->map =syscon_node_to_regmap (pdev->dev.parent->of_node);if (IS_ERR (bt_bmc->map)) { -struct resource *res;void __iomem *base;/* * Assume it's not the MFD-based devicetree description, in * which case generate a regmap ourselves */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);
Signature · 1 line
2.7.4
Quoted 2 lines · YueHaibing
Use
devm_platform_ioremap_resource()to simplify the code a bit. This is detected by coccinelle.
Adding the module author and others. I can't see a reason to not do this.
-corey
Quoted 31 lines
Signed-off-by YueHaibing <[email protected]>--- drivers/char/ipmi/bt-bmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/char/ipmi/bt-bmc.c +1
-3@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev) bt_bmc->map =syscon_node_to_regmap (pdev->dev.parent->of_node);if (IS_ERR (bt_bmc->map)) { -struct resource *res;void __iomem *base;/* * Assume it's not the MFD-based devicetree description, in * which case generate a regmap ourselves */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);Signature · 1 line
2.7.4
Cédric Le Goater
Reviewed-byQuoted 6 lines · Corey Minyard
Quoted 2 lines · YueHaibing
Use
devm_platform_ioremap_resource()to simplify the code a bit. This is detected by coccinelle.Adding the module author and others. I can't see a reason to not do this.
yes. Looks good to me.
Thanks,
C.
Quoted 33 lines
-corey
Quoted 31 lines
Signed-off-by YueHaibing <[email protected]>--- drivers/char/ipmi/bt-bmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/char/ipmi/bt-bmc.c +1
-3@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev) bt_bmc->map =syscon_node_to_regmap (pdev->dev.parent->of_node);if (IS_ERR (bt_bmc->map)) { -struct resource *res;void __iomem *base;/* * Assume it's not the MFD-based devicetree description, in * which case generate a regmap ourselves */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);Signature · 1 line
2.7.4
Quoted 11 lines · Cédric Le Goater
Quoted 6 lines · Corey Minyard
Quoted 2 lines · YueHaibing
Use
devm_platform_ioremap_resource()to simplify the code a bit. This is detected by coccinelle.Adding the module author and others. I can't see a reason to not do this.
yes. Looks good to me.
Reviewed-by Cédric Le Goater <[email protected]>
Queued for next merge window, unless someone protests.
-corey
Quoted 39 lines
Thanks,
C.
Quoted 33 lines
-corey
Quoted 31 lines
Signed-off-by YueHaibing <[email protected]>--- drivers/char/ipmi/bt-bmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/char/ipmi/bt-bmc.c +1
-3@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev) bt_bmc->map =syscon_node_to_regmap (pdev->dev.parent->of_node);if (IS_ERR (bt_bmc->map)) { -struct resource *res;void __iomem *base;/* * Assume it's not the MFD-based devicetree description, in * which case generate a regmap ourselves */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);Signature · 1 line
2.7.4