leds-bcm63xx: Use devm_platform_ioremap_resource() in two functions
Subsystems (2)
PATCH 1/1 leds-bcm63xx: Use devm_platform_ioremap_resource() in two functions
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 10:45:24 +0200
Simplify these function implementations by using a known function.
This issue was detected by using the Coccinelle software.
--- drivers/leds/leds-bcm6328.c | 7 +------ drivers/leds/leds-bcm6358.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-)
drivers/leds/leds-bcm6328.c +1 -6
@@ -346,16 +346,11 @@ static int bcm6328_leds_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = pdev->dev.of_node;struct device_node *child; -struct resource *mem_r;void __iomem *mem;spinlock_t *lock;/* memory lock */ unsigned long val, *blink_leds, *blink_delay; - mem_r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem_r) -return -EINVAL ; - - mem =devm_ioremap_resource (dev, mem_r); + mem =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mem))return PTR_ERR (mem);
drivers/leds/leds-bcm6358.c +1 -6
@@ -151,17 +151,12 @@ static int bcm6358_leds_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = pdev->dev.of_node;struct device_node *child; -struct resource *mem_r;void __iomem *mem;spinlock_t *lock;/* memory lock */ unsigned long val;u32 clk_div; - mem_r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem_r) -return -EINVAL ; - - mem =devm_ioremap_resource (dev, mem_r); + mem =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mem))return PTR_ERR (mem);
--
2.23.0
Hi Markus,
Thank you for the patch.
Please split it to two separate ones - one per affected driver.
Best regards,
Jacek Anaszewski
Quoted 12 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 10:45:24 +0200Simplify these function implementations by using a known function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/leds/leds-bcm6328.c | 7 +------ drivers/leds/leds-bcm6358.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-)
PATCH v2 1/1 leds-bcm6328: Use devm_platform_ioremap_resource() in bcm6328_leds_probe()
From: Markus Elfring <[email protected]>
Date: Fri, 20 Sep 2019 14:30:31 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
---
v2:
Jacek Anaszewski requested to split updates for two modules
into a separate patch for each driver.
https://lore.kernel.org/r/[email protected]/
drivers/leds/leds-bcm6328.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/leds/leds-bcm6328.c +1 -6
@@ -346,16 +346,11 @@ static int bcm6328_leds_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = pdev->dev.of_node;struct device_node *child; -struct resource *mem_r;void __iomem *mem;spinlock_t *lock;/* memory lock */ unsigned long val, *blink_leds, *blink_delay; - mem_r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem_r) -return -EINVAL ; - - mem =devm_ioremap_resource (dev, mem_r); + mem =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mem))return PTR_ERR (mem);
--
2.23.0
Jacek Anaszewski
AppliedRe: [PATCH v2] leds-bcm6328: Use devm_platform_ioremap_resource() in bcm6328_leds_probe()
Hi Markus,
Thank you for the updated patch set.
Applied to the for-5.5 branch.
Best regards,
Jacek Anaszewski
Quoted 50 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 20 Sep 2019 14:30:31 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>---
v2:
Jacek Anaszewski requested to split updates for two modules
into a separate patch for each driver.
https://lore.kernel.org/r/[email protected]/
drivers/leds/leds-bcm6328.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/leds/leds-bcm6328.c +1
-7@@ -346,16 +346,11 @@ static int bcm6328_leds_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = pdev->dev.of_node;struct device_node *child; -struct resource *mem_r;void __iomem *mem;spinlock_t *lock;/* memory lock */ unsigned long val, *blink_leds, *blink_delay; - mem_r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem_r) -return -EINVAL ; - - mem =devm_ioremap_resource (dev, mem_r); + mem =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mem))return PTR_ERR (mem); --2.23.0
PATCH v2 1/1 leds-bcm6358: Use devm_platform_ioremap_resource() in bcm6358_leds_probe()
In reply to Jacek AnaszewskiFrom: Markus Elfring <[email protected]>
Date: Fri, 20 Sep 2019 14:44:06 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
---
v2:
Jacek Anaszewski requested to split updates for two modules into a separate patch for each driver.
https://lore.kernel.org/r/[email protected]/
drivers/leds/leds-bcm6358.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/leds/leds-bcm6358.c +1 -6
@@ -151,17 +151,12 @@ static int bcm6358_leds_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = pdev->dev.of_node;struct device_node *child; -struct resource *mem_r;void __iomem *mem;spinlock_t *lock;/* memory lock */ unsigned long val;u32 clk_div; - mem_r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem_r) -return -EINVAL ; - - mem =devm_ioremap_resource (dev, mem_r); + mem =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mem))return PTR_ERR (mem);
--
2.23.0