diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2019-09-20 15:44:06 +0300 |
---|---|---|
committer | Pavel <pavel@ucw.cz> | 2019-11-03 19:37:24 +0300 |
commit | 8b4423d6c5e6515bf6ad7c6c51dfb0a4a95ec606 (patch) | |
tree | f85a5f5832736d9b41339d03cc82163f44feb401 /drivers/leds/leds-bcm6358.c | |
parent | be9f18eef60197a0da8bc514f7bb9512dbc04c48 (diff) | |
download | linux-8b4423d6c5e6515bf6ad7c6c51dfb0a4a95ec606.tar.xz |
leds: bcm6358: Use devm_platform_ioremap_resource() in bcm6358_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>
Diffstat (limited to 'drivers/leds/leds-bcm6358.c')
-rw-r--r-- | drivers/leds/leds-bcm6358.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/leds/leds-bcm6358.c b/drivers/leds/leds-bcm6358.c index aec285fd21c0..94fefd456ba0 100644 --- a/drivers/leds/leds-bcm6358.c +++ b/drivers/leds/leds-bcm6358.c @@ -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); |