Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: bcm6328: Use devm_platform_ioremap_resource() in bcm6328_leds_probe()

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Pavel Machek <pavel@ucw.cz>

authored by

Markus Elfring and committed by
Pavel
be9f18ee b46d2b4d

+1 -6
+1 -6
drivers/leds/leds-bcm6328.c
··· 346 346 struct device *dev = &pdev->dev; 347 347 struct device_node *np = pdev->dev.of_node; 348 348 struct device_node *child; 349 - struct resource *mem_r; 350 349 void __iomem *mem; 351 350 spinlock_t *lock; /* memory lock */ 352 351 unsigned long val, *blink_leds, *blink_delay; 353 352 354 - mem_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 355 - if (!mem_r) 356 - return -EINVAL; 357 - 358 - mem = devm_ioremap_resource(dev, mem_r); 353 + mem = devm_platform_ioremap_resource(pdev, 0); 359 354 if (IS_ERR(mem)) 360 355 return PTR_ERR(mem); 361 356