clocksource/drivers/em_sti: Convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code, which wraps 'platform_get_resource' and 'devm_ioremap_resource' in a single helper. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20191221173027.30716-2-tiny.windzz@gmail.com
This commit is contained in:
parent
2052d032c0
commit
9a97b2fb07
@ -279,7 +279,6 @@ static void em_sti_register_clockevent(struct em_sti_priv *p)
|
||||
static int em_sti_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct em_sti_priv *p;
|
||||
struct resource *res;
|
||||
int irq;
|
||||
int ret;
|
||||
|
||||
@ -295,8 +294,7 @@ static int em_sti_probe(struct platform_device *pdev)
|
||||
return irq;
|
||||
|
||||
/* map memory, let base point to the STI instance */
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
p->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
p->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(p->base))
|
||||
return PTR_ERR(p->base);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user