2023-07-04 12:04:13

by 李扬韬

[permalink] [raw]
Subject: [PATCH 1/7] reset: brcmstb: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/reset/reset-brcmstb.c b/drivers/reset/reset-brcmstb.c
index 42c9d5241c53..810fe76452d6 100644
--- a/drivers/reset/reset-brcmstb.c
+++ b/drivers/reset/reset-brcmstb.c
@@ -90,8 +90,7 @@ static int brcmstb_reset_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(kdev, res);
+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);

--
2.39.0



2023-07-04 12:04:28

by 李扬韬

[permalink] [raw]
Subject: [PATCH 2/7] reset: meson-audio-arb: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-meson-audio-arb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
index 6a3f6a6a3bbf..355e041214bd 100644
--- a/drivers/reset/reset-meson-audio-arb.c
+++ b/drivers/reset/reset-meson-audio-arb.c
@@ -138,7 +138,6 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
const struct meson_audio_arb_match_data *data;
struct meson_audio_arb_data *arb;
- struct resource *res;
int ret;

data = of_device_get_match_data(dev);
@@ -154,8 +153,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
if (IS_ERR(arb->clk))
return dev_err_probe(dev, PTR_ERR(arb->clk), "failed to get clock\n");

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- arb->regs = devm_ioremap_resource(dev, res);
+ arb->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(arb->regs))
return PTR_ERR(arb->regs);

--
2.39.0


2023-07-04 12:04:52

by 李扬韬

[permalink] [raw]
Subject: [PATCH 6/7] reset: sunplus: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-sunplus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/reset/reset-sunplus.c b/drivers/reset/reset-sunplus.c
index 2f23ecaa7b98..df58decab64d 100644
--- a/drivers/reset/reset-sunplus.c
+++ b/drivers/reset/reset-sunplus.c
@@ -176,8 +176,7 @@ static int sp_reset_probe(struct platform_device *pdev)
if (!reset)
return -ENOMEM;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- reset->base = devm_ioremap_resource(dev, res);
+ reset->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(reset->base))
return PTR_ERR(reset->base);

--
2.39.0


2023-07-04 12:04:58

by 李扬韬

[permalink] [raw]
Subject: [PATCH 4/7] reset: qcom: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-qcom-pdc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/reset/reset-qcom-pdc.c b/drivers/reset/reset-qcom-pdc.c
index f22bb49a4ac8..ab245c701590 100644
--- a/drivers/reset/reset-qcom-pdc.c
+++ b/drivers/reset/reset-qcom-pdc.c
@@ -114,7 +114,6 @@ static int qcom_pdc_reset_probe(struct platform_device *pdev)
struct qcom_pdc_reset_data *data;
struct device *dev = &pdev->dev;
void __iomem *base;
- struct resource *res;

desc = device_get_match_data(&pdev->dev);
if (!desc)
@@ -125,8 +124,7 @@ static int qcom_pdc_reset_probe(struct platform_device *pdev)
return -ENOMEM;

data->desc = desc;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(dev, res);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);

--
2.39.0


2023-07-04 12:05:09

by 李扬韬

[permalink] [raw]
Subject: [PATCH 7/7] reset: uniphier-glue: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-uniphier-glue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/reset/reset-uniphier-glue.c b/drivers/reset/reset-uniphier-glue.c
index 15abac9fc72c..8f315dcb10a8 100644
--- a/drivers/reset/reset-uniphier-glue.c
+++ b/drivers/reset/reset-uniphier-glue.c
@@ -58,8 +58,7 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
priv->data->nrsts > MAX_RSTS))
return -EINVAL;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->rdata.membase = devm_ioremap_resource(dev, res);
+ priv->rdata.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->rdata.membase))
return PTR_ERR(priv->rdata.membase);

--
2.39.0


2023-07-04 12:12:45

by 李扬韬

[permalink] [raw]
Subject: [PATCH 5/7] reset: simple: Convert to devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-simple.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c
index 361a68314265..1133b2af7692 100644
--- a/drivers/reset/reset-simple.c
+++ b/drivers/reset/reset-simple.c
@@ -170,8 +170,7 @@ static int reset_simple_probe(struct platform_device *pdev)
if (!data)
return -ENOMEM;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- membase = devm_ioremap_resource(dev, res);
+ membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(membase))
return PTR_ERR(membase);

--
2.39.0


2023-07-04 12:12:52

by 李扬韬

[permalink] [raw]
Subject: [PATCH 3/7] reset: qcom-aoss: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/reset/reset-qcom-aoss.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/reset/reset-qcom-aoss.c b/drivers/reset/reset-qcom-aoss.c
index 9333b923dda0..28151cbd30eb 100644
--- a/drivers/reset/reset-qcom-aoss.c
+++ b/drivers/reset/reset-qcom-aoss.c
@@ -90,7 +90,6 @@ static int qcom_aoss_reset_probe(struct platform_device *pdev)
struct qcom_aoss_reset_data *data;
struct device *dev = &pdev->dev;
const struct qcom_aoss_desc *desc;
- struct resource *res;

desc = of_device_get_match_data(dev);
if (!desc)
@@ -101,8 +100,7 @@ static int qcom_aoss_reset_probe(struct platform_device *pdev)
return -ENOMEM;

data->desc = desc;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data->base = devm_ioremap_resource(dev, res);
+ data->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(data->base))
return PTR_ERR(data->base);

--
2.39.0


2023-07-04 12:19:24

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 2/7] reset: meson-audio-arb: Convert to devm_platform_ioremap_resource()

On 04/07/2023 14:02, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/reset/reset-meson-audio-arb.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
> index 6a3f6a6a3bbf..355e041214bd 100644
> --- a/drivers/reset/reset-meson-audio-arb.c
> +++ b/drivers/reset/reset-meson-audio-arb.c
> @@ -138,7 +138,6 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> const struct meson_audio_arb_match_data *data;
> struct meson_audio_arb_data *arb;
> - struct resource *res;
> int ret;
>
> data = of_device_get_match_data(dev);
> @@ -154,8 +153,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
> if (IS_ERR(arb->clk))
> return dev_err_probe(dev, PTR_ERR(arb->clk), "failed to get clock\n");
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - arb->regs = devm_ioremap_resource(dev, res);
> + arb->regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(arb->regs))
> return PTR_ERR(arb->regs);
>

Reviewed-by: Neil Armstrong <[email protected]>

2023-07-04 15:23:24

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 1/7] reset: brcmstb: Use devm_platform_get_and_ioremap_resource()



On 7/4/2023 2:02 PM, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2023-11-29 11:50:14

by Philipp Zabel

[permalink] [raw]
Subject: Re: [PATCH 1/7] reset: brcmstb: Use devm_platform_get_and_ioremap_resource()

On Tue, 04 Jul 2023 20:02:05 +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
>

Applied to reset/next, thanks!

[1/7] reset: brcmstb: Use devm_platform_get_and_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=1750ec405933
[2/7] reset: meson-audio-arb: Convert to devm_platform_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=66a1f3929a52
[3/7] reset: qcom-aoss: Convert to devm_platform_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=3d471cfbf26c
[4/7] reset: qcom: Convert to devm_platform_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=49994d704d39
[5/7] reset: simple: Convert to devm_platform_get_and_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=ac53e621d802
[6/7] reset: sunplus: Use devm_platform_get_and_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=5d587019fcca
[7/7] reset: uniphier-glue: Use devm_platform_get_and_ioremap_resource()
https://git.pengutronix.de/cgit/pza/linux/commit/?id=c64548122968

regards
Philipp