2023-07-06 12:07:23

by 李扬韬

[permalink] [raw]
Subject: [PATCH 1/7] mfd: atmel-hlcdc: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
index 3c2414ba4b01..20de7f49a830 100644
--- a/drivers/mfd/atmel-hlcdc.c
+++ b/drivers/mfd/atmel-hlcdc.c
@@ -83,7 +83,6 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
struct atmel_hlcdc_regmap *hregmap;
struct device *dev = &pdev->dev;
struct atmel_hlcdc *hlcdc;
- struct resource *res;

hregmap = devm_kzalloc(dev, sizeof(*hregmap), GFP_KERNEL);
if (!hregmap)
@@ -93,8 +92,7 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
if (!hlcdc)
return -ENOMEM;

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

--
2.39.0



2023-07-06 12:07:27

by 李扬韬

[permalink] [raw]
Subject: [PATCH 5/7] mfd: omap-usb-host: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 7f5775109593..78f1bb55dbc0 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -534,7 +534,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
struct usbhs_hcd_omap *omap;
- struct resource *res;
int ret = 0;
int i;
bool need_logic_fck;
@@ -569,8 +568,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
return -ENOMEM;
}

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

--
2.39.0


2023-07-06 12:12:37

by 李扬韬

[permalink] [raw]
Subject: [PATCH 4/7] mfd: exynos-lpass: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/mfd/exynos-lpass.c b/drivers/mfd/exynos-lpass.c
index 166cd21088cd..1506d8d352b1 100644
--- a/drivers/mfd/exynos-lpass.c
+++ b/drivers/mfd/exynos-lpass.c
@@ -109,14 +109,12 @@ static int exynos_lpass_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct exynos_lpass *lpass;
void __iomem *base_top;
- struct resource *res;

lpass = devm_kzalloc(dev, sizeof(*lpass), GFP_KERNEL);
if (!lpass)
return -ENOMEM;

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

--
2.39.0


2023-07-06 12:30:24

by 李扬韬

[permalink] [raw]
Subject: [PATCH 2/7] mfd: omap-usb-tll: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 69cbc2097911..906353735c78 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -200,15 +200,13 @@ static unsigned ohci_omap3_fslsmode(enum usbhs_omap_port_mode mode)
static int usbtll_omap_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *res;
struct usbtll_omap *tll;
void __iomem *base;
int i, nch, ver;

dev_dbg(dev, "starting TI HSUSB TLL Controller\n");

- 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-06 12:31:00

by 李扬韬

[permalink] [raw]
Subject: [PATCH 6/7] mfd: stm32-timers: 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/mfd/stm32-timers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c
index 44ed2fce0319..dc0cd0808736 100644
--- a/drivers/mfd/stm32-timers.c
+++ b/drivers/mfd/stm32-timers.c
@@ -226,8 +226,7 @@ static int stm32_timers_probe(struct platform_device *pdev)
if (!ddata)
return -ENOMEM;

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

--
2.39.0


2023-07-13 14:11:08

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/7] mfd: atmel-hlcdc: Convert to devm_platform_ioremap_resource()

On Thu, 06 Jul 2023, Yangtao Li wrote:

> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/mfd/atmel-hlcdc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

2023-07-13 14:15:14

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 2/7] mfd: omap-usb-tll: Convert to devm_platform_ioremap_resource()

On Thu, 06 Jul 2023, Yangtao Li wrote:

> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/mfd/omap-usb-tll.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

2023-07-13 14:16:38

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 5/7] mfd: omap-usb-host: Convert to devm_platform_ioremap_resource()

On Thu, 06 Jul 2023, Yangtao Li wrote:

> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/mfd/omap-usb-host.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

2023-07-13 14:17:07

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 6/7] mfd: stm32-timers: Use devm_platform_get_and_ioremap_resource()

On Thu, 06 Jul 2023, 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]>
> ---
> drivers/mfd/stm32-timers.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

2023-07-13 14:17:25

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 4/7] mfd: exynos-lpass: Convert to devm_platform_ioremap_resource()

On Thu, 06 Jul 2023, Yangtao Li wrote:

> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> drivers/mfd/exynos-lpass.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]