* [PATCH -next] clk: sprd: use devm_platform_ioremap_resource() to simplify code
@ 2019-10-15 14:21 YueHaibing
2019-10-16 1:35 ` Baolin Wang
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-10-15 14:21 UTC (permalink / raw)
To: mturquette, sboyd, orsonzhai, baolin.wang, zhang.lyra, yuehaibing
Cc: linux-clk, linux-kernel
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/clk/sprd/common.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
index 9d56eac..3718696 100644
--- a/drivers/clk/sprd/common.c
+++ b/drivers/clk/sprd/common.c
@@ -42,7 +42,6 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
void __iomem *base;
struct device_node *node = pdev->dev.of_node;
struct regmap *regmap;
- struct resource *res;
if (of_find_property(node, "sprd,syscon", NULL)) {
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
@@ -51,8 +50,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
return PTR_ERR(regmap);
}
} else {
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] clk: sprd: use devm_platform_ioremap_resource() to simplify code
2019-10-15 14:21 [PATCH -next] clk: sprd: use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-10-16 1:35 ` Baolin Wang
0 siblings, 0 replies; 2+ messages in thread
From: Baolin Wang @ 2019-10-16 1:35 UTC (permalink / raw)
To: YueHaibing
Cc: Michael Turquette, Stephen Boyd, Orson Zhai, Chunyan Zhang,
linux-clk, LKML
Hi,
On Tue, 15 Oct 2019 at 22:22, YueHaibing <yuehaibing@huawei.com> wrote:
>
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
We already posted a patch to do this, thanks anyway.
https://lore.kernel.org/patchwork/patch/1136894/
> ---
> drivers/clk/sprd/common.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
> index 9d56eac..3718696 100644
> --- a/drivers/clk/sprd/common.c
> +++ b/drivers/clk/sprd/common.c
> @@ -42,7 +42,6 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
> void __iomem *base;
> struct device_node *node = pdev->dev.of_node;
> struct regmap *regmap;
> - struct resource *res;
>
> if (of_find_property(node, "sprd,syscon", NULL)) {
> regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
> @@ -51,8 +50,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
> return PTR_ERR(regmap);
> }
> } else {
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - base = devm_ioremap_resource(&pdev->dev, res);
> + base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(base))
> return PTR_ERR(base);
>
> --
> 2.7.4
>
>
--
Baolin Wang
Best Regards
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-16 1:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 14:21 [PATCH -next] clk: sprd: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-10-16 1:35 ` Baolin Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.