2023-07-04 13:05:20

by 李扬韬

[permalink] [raw]
Subject: [PATCH 1/6] power: reset: at91-poweroff: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
index 9e74e131c675..dd5399785b69 100644
--- a/drivers/power/reset/at91-poweroff.c
+++ b/drivers/power/reset/at91-poweroff.c
@@ -151,13 +151,11 @@ static void at91_poweroff_dt_set_wakeup_mode(struct platform_device *pdev)

static int __init at91_poweroff_probe(struct platform_device *pdev)
{
- struct resource *res;
struct device_node *np;
u32 ddr_type;
int ret;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- at91_shdwc.shdwc_base = devm_ioremap_resource(&pdev->dev, res);
+ at91_shdwc.shdwc_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(at91_shdwc.shdwc_base))
return PTR_ERR(at91_shdwc.shdwc_base);

--
2.39.0



2023-07-04 13:05:47

by 李扬韬

[permalink] [raw]
Subject: [PATCH 5/6] power: reset: msm: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index 0c439f83bf65..5921acc5c51d 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -36,10 +36,8 @@ static void do_msm_poweroff(void)
static int msm_restart_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *mem;

- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- msm_ps_hold = devm_ioremap_resource(dev, mem);
+ msm_ps_hold = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(msm_ps_hold))
return PTR_ERR(msm_ps_hold);

--
2.39.0


2023-07-04 13:14:42

by 李扬韬

[permalink] [raw]
Subject: [PATCH 2/6] power: reset: at91-sama5d2_shdwc: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
index d8ecffe72f16..e76b102b57b1 100644
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -331,7 +331,6 @@ static const struct of_device_id at91_pmc_ids[] = {

static int __init at91_shdwc_probe(struct platform_device *pdev)
{
- struct resource *res;
const struct of_device_id *match;
struct device_node *np;
u32 ddr_type;
@@ -349,8 +348,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, at91_shdwc);

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

--
2.39.0


2023-07-04 13:14:46

by 李扬韬

[permalink] [raw]
Subject: [PATCH 3/6] power: reset: brcm-kona: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/brcm-kona-reset.c b/drivers/power/reset/brcm-kona-reset.c
index 3de024e3ceb7..6444f6154761 100644
--- a/drivers/power/reset/brcm-kona-reset.c
+++ b/drivers/power/reset/brcm-kona-reset.c
@@ -38,9 +38,7 @@ static struct notifier_block kona_reset_nb = {

static int kona_reset_probe(struct platform_device *pdev)
{
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- kona_reset_base = devm_ioremap_resource(&pdev->dev, res);
+ kona_reset_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(kona_reset_base))
return PTR_ERR(kona_reset_base);

--
2.39.0


2023-07-04 13:15:00

by 李扬韬

[permalink] [raw]
Subject: [PATCH 4/6] power: reset: gemini-poweroff: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/gemini-poweroff.c b/drivers/power/reset/gemini-poweroff.c
index b7f7a8225f22..d309b610142c 100644
--- a/drivers/power/reset/gemini-poweroff.c
+++ b/drivers/power/reset/gemini-poweroff.c
@@ -91,7 +91,6 @@ static void gemini_poweroff(void)
static int gemini_poweroff_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *res;
struct gemini_powercon *gpw;
u32 val;
int irq;
@@ -101,8 +100,7 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
if (!gpw)
return -ENOMEM;

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

--
2.39.0


2023-07-04 13:20:27

by 李扬韬

[permalink] [raw]
Subject: [PATCH 6/6] power: reset: ocelot: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/power/reset/ocelot-reset.c b/drivers/power/reset/ocelot-reset.c
index 8caa90cb58fc..031772a60b1a 100644
--- a/drivers/power/reset/ocelot-reset.c
+++ b/drivers/power/reset/ocelot-reset.c
@@ -69,8 +69,6 @@ static int ocelot_restart_handle(struct notifier_block *this,
static int ocelot_reset_probe(struct platform_device *pdev)
{
struct ocelot_reset_context *ctx;
- struct resource *res;
-
struct device *dev = &pdev->dev;
int err;

@@ -78,8 +76,7 @@ static int ocelot_reset_probe(struct platform_device *pdev)
if (!ctx)
return -ENOMEM;

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

--
2.39.0


2023-07-04 15:05:09

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 3/6] power: reset: brcm-kona: Convert to devm_platform_ioremap_resource()



On 7/4/2023 3:03 PM, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> 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-07-19 22:00:50

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH 1/6] power: reset: at91-poweroff: Convert to devm_platform_ioremap_resource()

Hi,

On Tue, Jul 04, 2023 at 09:03:03PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---

Thanks, whole series queued.

-- Sebastian

> drivers/power/reset/at91-poweroff.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
> index 9e74e131c675..dd5399785b69 100644
> --- a/drivers/power/reset/at91-poweroff.c
> +++ b/drivers/power/reset/at91-poweroff.c
> @@ -151,13 +151,11 @@ static void at91_poweroff_dt_set_wakeup_mode(struct platform_device *pdev)
>
> static int __init at91_poweroff_probe(struct platform_device *pdev)
> {
> - struct resource *res;
> struct device_node *np;
> u32 ddr_type;
> int ret;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - at91_shdwc.shdwc_base = devm_ioremap_resource(&pdev->dev, res);
> + at91_shdwc.shdwc_base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(at91_shdwc.shdwc_base))
> return PTR_ERR(at91_shdwc.shdwc_base);
>
> --
> 2.39.0
>


Attachments:
(No filename) (1.12 kB)
signature.asc (849.00 B)
Download all attachments