Skip to content

Commit 1f8f3c6

Browse files
YueHaibingbebarino
authored andcommitted
clk: davinci: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 75cc0a1 commit 1f8f3c6

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

drivers/clk/davinci/pll.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ static int davinci_pll_probe(struct platform_device *pdev)
910910
struct davinci_pll_platform_data *pdata;
911911
const struct of_device_id *of_id;
912912
davinci_pll_init pll_init = NULL;
913-
struct resource *res;
914913
void __iomem *base;
915914

916915
of_id = of_match_device(davinci_pll_of_match, dev);
@@ -930,8 +929,7 @@ static int davinci_pll_probe(struct platform_device *pdev)
930929
return -EINVAL;
931930
}
932931

933-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
934-
base = devm_ioremap_resource(dev, res);
932+
base = devm_platform_ioremap_resource(pdev, 0);
935933
if (IS_ERR(base))
936934
return PTR_ERR(base);
937935

drivers/clk/davinci/psc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ static int davinci_psc_probe(struct platform_device *pdev)
531531
struct device *dev = &pdev->dev;
532532
const struct of_device_id *of_id;
533533
const struct davinci_psc_init_data *init_data = NULL;
534-
struct resource *res;
535534
void __iomem *base;
536535
int ret;
537536

@@ -546,8 +545,7 @@ static int davinci_psc_probe(struct platform_device *pdev)
546545
return -EINVAL;
547546
}
548547

549-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
550-
base = devm_ioremap_resource(dev, res);
548+
base = devm_platform_ioremap_resource(pdev, 0);
551549
if (IS_ERR(base))
552550
return PTR_ERR(base);
553551

0 commit comments

Comments
 (0)