2023-07-05 08:24:16

by 李扬韬

[permalink] [raw]
Subject: [PATCH 1/5] dmaengine: qcom: gpi: 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/dma/qcom/gpi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
index 932628b319c8..1c93864e0e4d 100644
--- a/drivers/dma/qcom/gpi.c
+++ b/drivers/dma/qcom/gpi.c
@@ -2160,8 +2160,7 @@ static int gpi_probe(struct platform_device *pdev)
return -ENOMEM;

gpi_dev->dev = &pdev->dev;
- gpi_dev->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- gpi_dev->regs = devm_ioremap_resource(gpi_dev->dev, gpi_dev->res);
+ gpi_dev->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &gpi_dev->res);
if (IS_ERR(gpi_dev->regs))
return PTR_ERR(gpi_dev->regs);
gpi_dev->ee_base = gpi_dev->regs;
--
2.39.0



2023-07-05 08:39:03

by 李扬韬

[permalink] [raw]
Subject: [PATCH 4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/dma/sh/shdmac.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
index 5aafe548ca5f..fb3c56a416d1 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -678,7 +678,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
int err, errirq, i, irq_cnt = 0, irqres = 0, irq_cap = 0;
struct sh_dmae_device *shdev;
struct dma_device *dma_dev;
- struct resource *chan, *dmars, *errirq_res, *chanirq_res;
+ struct resource *dmars, *errirq_res, *chanirq_res;

if (pdev->dev.of_node)
pdata = of_device_get_match_data(&pdev->dev);
@@ -689,7 +689,6 @@ static int sh_dmae_probe(struct platform_device *pdev)
if (!pdata || !pdata->channel_num)
return -ENODEV;

- chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
/* DMARS area is optional */
dmars = platform_get_resource(pdev, IORESOURCE_MEM, 1);
/*
@@ -709,7 +708,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
* requested with the IRQF_SHARED flag
*/
errirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!chan || !errirq_res)
+ if (!errirq_res)
return -ENODEV;

shdev = devm_kzalloc(&pdev->dev, sizeof(struct sh_dmae_device),
@@ -719,7 +718,7 @@ static int sh_dmae_probe(struct platform_device *pdev)

dma_dev = &shdev->shdma_dev.dma_dev;

- shdev->chan_reg = devm_ioremap_resource(&pdev->dev, chan);
+ shdev->chan_reg = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(shdev->chan_reg))
return PTR_ERR(shdev->chan_reg);
if (dmars) {
--
2.39.0


2023-07-05 08:41:01

by 李扬韬

[permalink] [raw]
Subject: [PATCH 2/5] dmaengine: qcom_hidma: 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/dma/qcom/hidma.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 344525c3a32f..b5e3633e6a5e 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -765,17 +765,15 @@ static int hidma_probe(struct platform_device *pdev)
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);

- trca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- trca = devm_ioremap_resource(&pdev->dev, trca_resource);
+ trca = devm_platform_get_and_ioremap_resource(pdev, 0, &trca_resource);
if (IS_ERR(trca)) {
- rc = -ENOMEM;
+ rc = PTR_ERR(trca);
goto bailout;
}

- evca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- evca = devm_ioremap_resource(&pdev->dev, evca_resource);
+ evca = devm_platform_get_and_ioremap_resource(pdev, 1, &evca_resource);
if (IS_ERR(evca)) {
- rc = -ENOMEM;
+ rc = PTR_ERR(evca);
goto bailout;
}

@@ -785,7 +783,7 @@ static int hidma_probe(struct platform_device *pdev)
*/
chirq = platform_get_irq(pdev, 0);
if (chirq < 0) {
- rc = -ENODEV;
+ rc = chirq;
goto bailout;
}

--
2.39.0


2023-07-05 08:41:31

by 李扬韬

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

diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 37674029cb42..5c36811aa134 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -1581,8 +1581,7 @@ static int stm32_dma_probe(struct platform_device *pdev)

dd = &dmadev->ddev;

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

--
2.39.0


2023-07-06 07:40:37

by Amelie Delaunay

[permalink] [raw]
Subject: Re: [Linux-stm32] [PATCH 5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource()



On 7/5/23 10:18, 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]>

Reviewed-by: Amelie Delaunay <[email protected]>
Tested-by: Amelie Delaunay <[email protected]>

> ---
> drivers/dma/stm32-dma.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
> index 37674029cb42..5c36811aa134 100644
> --- a/drivers/dma/stm32-dma.c
> +++ b/drivers/dma/stm32-dma.c
> @@ -1581,8 +1581,7 @@ static int stm32_dma_probe(struct platform_device *pdev)
>
> dd = &dmadev->ddev;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - dmadev->base = devm_ioremap_resource(&pdev->dev, res);
> + dmadev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> if (IS_ERR(dmadev->base))
> return PTR_ERR(dmadev->base);
>

2023-07-11 17:06:37

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()


On Wed, 05 Jul 2023 16:18:52 +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, thanks!

[1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()
commit: d9313d9f1fbc14cae5147c5130bea54aa76ad65f
[2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()
commit: a189107deb574fd08018bbf2fe5cd86450a54b13
[3/5] dmaengine: qcom: hidma_mgmt: Use devm_platform_get_and_ioremap_resource()
commit: fe6c2622473f3756a09bd6c42cffca6fbdce391c
[4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource()
commit: 0976421c5a339b1b1a89cfba4471a6de761130ed
[5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource()
commit: b402a7eeaa35aaa3300a4ba6bd5b381112ae183c

Best regards,
--
~Vinod



2023-07-12 10:00:27

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()

Hi Vinod,

On Tue, 11 Jul 2023, Vinod Koul wrote:
> On Wed, 05 Jul 2023 16:18:52 +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, thanks!
>
> [1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()
> commit: d9313d9f1fbc14cae5147c5130bea54aa76ad65f
> [2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()
> commit: a189107deb574fd08018bbf2fe5cd86450a54b13
> [3/5] dmaengine: qcom: hidma_mgmt: Use devm_platform_get_and_ioremap_resource()
> commit: fe6c2622473f3756a09bd6c42cffca6fbdce391c
> [4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource()
> commit: 0976421c5a339b1b1a89cfba4471a6de761130ed
> [5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource()
> commit: b402a7eeaa35aaa3300a4ba6bd5b381112ae183c

I noticed all your new dmaengine[1] and phy[2] commits contain a
"Message-ID:" tag. Presumable you added a git hook for that?

However, the standard way is to add a Link: tag pointing to lore
instead, cfr. [3].

Thanks!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/commit/?h=next
[2] https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git/commit/?h=next
[3] https://docs.kernel.org/maintainer/configure-git.html#creating-commit-links-to-lore-kernel-org

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2023-07-12 12:12:23

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()

On 12-07-23, 11:33, Geert Uytterhoeven wrote:
> Hi Vinod,
>
> On Tue, 11 Jul 2023, Vinod Koul wrote:
> > On Wed, 05 Jul 2023 16:18:52 +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, thanks!
> >
> > [1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()
> > commit: d9313d9f1fbc14cae5147c5130bea54aa76ad65f
> > [2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()
> > commit: a189107deb574fd08018bbf2fe5cd86450a54b13
> > [3/5] dmaengine: qcom: hidma_mgmt: Use devm_platform_get_and_ioremap_resource()
> > commit: fe6c2622473f3756a09bd6c42cffca6fbdce391c
> > [4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource()
> > commit: 0976421c5a339b1b1a89cfba4471a6de761130ed
> > [5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource()
> > commit: b402a7eeaa35aaa3300a4ba6bd5b381112ae183c
>
> I noticed all your new dmaengine[1] and phy[2] commits contain a
> "Message-ID:" tag. Presumable you added a git hook for that?

Thanks for pointing that out, yes something is messed up for me.
>
> However, the standard way is to add a Link: tag pointing to lore
> instead, cfr. [3].

Yep and if you look at the dmaengine and phy commits for 6.4 they have
"Link" in them, so something is not working, let me fix that up.

--
~Vinod

2023-07-13 08:10:49

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()

Hi Vinod,

On Wed, Jul 12, 2023 at 1:30 PM Vinod Koul <[email protected]> wrote:
> On 12-07-23, 11:33, Geert Uytterhoeven wrote:
> > On Tue, 11 Jul 2023, Vinod Koul wrote:
> > > On Wed, 05 Jul 2023 16:18:52 +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, thanks!
> > >
> > > [1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()
> > > commit: d9313d9f1fbc14cae5147c5130bea54aa76ad65f
> > > [2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()
> > > commit: a189107deb574fd08018bbf2fe5cd86450a54b13
> > > [3/5] dmaengine: qcom: hidma_mgmt: Use devm_platform_get_and_ioremap_resource()
> > > commit: fe6c2622473f3756a09bd6c42cffca6fbdce391c
> > > [4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource()
> > > commit: 0976421c5a339b1b1a89cfba4471a6de761130ed
> > > [5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource()
> > > commit: b402a7eeaa35aaa3300a4ba6bd5b381112ae183c
> >
> > I noticed all your new dmaengine[1] and phy[2] commits contain a
> > "Message-ID:" tag. Presumable you added a git hook for that?
>
> Thanks for pointing that out, yes something is messed up for me.
>
> > However, the standard way is to add a Link: tag pointing to lore
> > instead, cfr. [3].
>
> Yep and if you look at the dmaengine and phy commits for 6.4 they have
> "Link" in them, so something is not working, let me fix that up.

Sorry, hadn't noticed that, so I assumed you were a new user ;-)

I saw you have already updated your branches, but FTR, the issue
was caused by a new version of git, which broke the hook, cfr. commit
2bb19e740e9b3eb4 ("Documentation: update git configuration for Link:
tag") in v6.5-rc1.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2023-07-13 18:48:41

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource()

Hi Geert,

On 13-07-23, 10:00, Geert Uytterhoeven wrote:
> On Wed, Jul 12, 2023 at 1:30 PM Vinod Koul <[email protected]> wrote:
> > On 12-07-23, 11:33, Geert Uytterhoeven wrote:
> >
> > Thanks for pointing that out, yes something is messed up for me.
> >
> > > However, the standard way is to add a Link: tag pointing to lore
> > > instead, cfr. [3].
> >
> > Yep and if you look at the dmaengine and phy commits for 6.4 they have
> > "Link" in them, so something is not working, let me fix that up.
>
> Sorry, hadn't noticed that, so I assumed you were a new user ;-)
>
> I saw you have already updated your branches, but FTR, the issue
> was caused by a new version of git, which broke the hook, cfr. commit
> 2bb19e740e9b3eb4 ("Documentation: update git configuration for Link:
> tag") in v6.5-rc1.

Yes that was exactly the cause, updating my hook fixed it up. Had to fix
all the commits in the trees though, thanks

--
~Vinod