mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
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>
This commit is contained in:
parent
b46d2b4d3d
commit
be9f18eef6
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user