Skip to content

Commit

Permalink
leds: bcm6328: Use devm_platform_ioremap_resource() in bcm6328_leds_p…
Browse files Browse the repository at this point in the history
…robe()

Simplify 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]>
Signed-off-by: Pavel Machek <[email protected]>
  • Loading branch information
elfring authored and pavelmachek committed Nov 3, 2019
1 parent b46d2b4 commit be9f18e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/leds/leds-bcm6328.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit be9f18e

Please sign in to comment.