* [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource()
@ 2023-07-06 12:42 Yangtao Li
2023-07-06 12:42 ` [PATCH 2/8] ata: ahci_seattle: " Yangtao Li
` (6 more replies)
0 siblings, 7 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Damien Le Moal; +Cc: Yangtao Li, linux-ide, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/ata/ahci_octeon.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ata/ahci_octeon.c b/drivers/ata/ahci_octeon.c
index e89807fa928e..9accf8923891 100644
--- a/drivers/ata/ahci_octeon.c
+++ b/drivers/ata/ahci_octeon.c
@@ -31,13 +31,11 @@ static int ahci_octeon_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
- struct resource *res;
void __iomem *base;
u64 cfg;
int ret;
- 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.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 2/8] ata: ahci_seattle: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 12:42 ` [PATCH 3/8] ata: ahci_xgene: " Yangtao Li
` (5 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Damien Le Moal; +Cc: Yangtao Li, linux-ide, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/ata/ahci_seattle.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
index 2c32d58c6ae7..a64c9c4704cd 100644
--- a/drivers/ata/ahci_seattle.c
+++ b/drivers/ata/ahci_seattle.c
@@ -132,8 +132,7 @@ static const struct ata_port_info *ahci_seattle_get_port_info(
if (!plat_data)
return &ahci_port_info;
- plat_data->sgpio_ctrl = devm_ioremap_resource(dev,
- platform_get_resource(pdev, IORESOURCE_MEM, 1));
+ plat_data->sgpio_ctrl = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(plat_data->sgpio_ctrl))
return &ahci_port_info;
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 3/8] ata: ahci_xgene: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 12:42 ` [PATCH 2/8] ata: ahci_seattle: " Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 12:42 ` [PATCH 4/8] ahci: tegra: " Yangtao Li
` (4 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Damien Le Moal; +Cc: Yangtao Li, linux-ide, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/ata/ahci_xgene.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index eb773f2e28fc..f5deaf648663 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -755,20 +755,17 @@ static int xgene_ahci_probe(struct platform_device *pdev)
ctx->dev = dev;
/* Retrieve the IP core resource */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- ctx->csr_core = devm_ioremap_resource(dev, res);
+ ctx->csr_core = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(ctx->csr_core))
return PTR_ERR(ctx->csr_core);
/* Retrieve the IP diagnostic resource */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
- ctx->csr_diag = devm_ioremap_resource(dev, res);
+ ctx->csr_diag = devm_platform_ioremap_resource(pdev, 2);
if (IS_ERR(ctx->csr_diag))
return PTR_ERR(ctx->csr_diag);
/* Retrieve the IP AXI resource */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
- ctx->csr_axi = devm_ioremap_resource(dev, res);
+ ctx->csr_axi = devm_platform_ioremap_resource(pdev, 3);
if (IS_ERR(ctx->csr_axi))
return PTR_ERR(ctx->csr_axi);
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 4/8] ahci: tegra: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 12:42 ` [PATCH 2/8] ata: ahci_seattle: " Yangtao Li
2023-07-06 12:42 ` [PATCH 3/8] ata: ahci_xgene: " Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 23:35 ` Damien Le Moal
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
` (3 subsequent siblings)
6 siblings, 1 reply; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Damien Le Moal, Thierry Reding, Jonathan Hunter
Cc: Yangtao Li, linux-ide, linux-tegra, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/ata/ahci_tegra.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 21c20793e517..d1a35da7e824 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -530,8 +530,7 @@ static int tegra_ahci_probe(struct platform_device *pdev)
tegra->pdev = pdev;
tegra->soc = of_device_get_match_data(&pdev->dev);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
+ tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(tegra->sata_regs))
return PTR_ERR(tegra->sata_regs);
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 5/8] ata: sata_rcar: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
` (2 preceding siblings ...)
2023-07-06 12:42 ` [PATCH 4/8] ahci: tegra: " Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 13:05 ` Geert Uytterhoeven
` (2 more replies)
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (2 subsequent siblings)
6 siblings, 3 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal
Cc: Yangtao Li, linux-ide, linux-renesas-soc, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/ata/sata_rcar.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 34790f15c1b8..63f8337c2a98 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -861,15 +861,11 @@ static int sata_rcar_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct ata_host *host;
struct sata_rcar_priv *priv;
- struct resource *mem;
- int irq;
- int ret = 0;
+ int irq, ret;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
- if (!irq)
- return -EINVAL;
priv = devm_kzalloc(dev, sizeof(struct sata_rcar_priv), GFP_KERNEL);
if (!priv)
@@ -890,8 +886,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
host->private_data = priv;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(dev, mem);
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base);
goto err_pm_put;
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
` (3 preceding siblings ...)
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 23:39 ` Damien Le Moal
2023-07-07 18:58 ` Sergey Shtylyov
2023-07-06 12:42 ` [PATCH 7/8] ata: pata_ftide010: " Yangtao Li
2023-07-06 12:42 ` Yangtao Li
6 siblings, 2 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal; +Cc: Yangtao Li, linux-ide, linux-kernel
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 <frank.li@vivo.com>
---
drivers/ata/pata_ixp4xx_cf.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index b1daa4d3fcd9..246bb4f8f1f7 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -242,12 +242,6 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
int ret;
int irq;
- cmd = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ctl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-
- if (!cmd || !ctl)
- return -EINVAL;
-
ixpp = devm_kzalloc(dev, sizeof(*ixpp), GFP_KERNEL);
if (!ixpp)
return -ENOMEM;
@@ -271,18 +265,18 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
if (ret)
return ret;
- ixpp->cmd = devm_ioremap_resource(dev, cmd);
- ixpp->ctl = devm_ioremap_resource(dev, ctl);
- if (IS_ERR(ixpp->cmd) || IS_ERR(ixpp->ctl))
- return -ENOMEM;
+ ixpp->cmd = devm_platform_get_and_ioremap_resource(pdev, 0, &cmd);
+ if (IS_ERR(ixpp->cmd))
+ return PTR_ERR(ixpp->cmd);
+
+ ixpp->ctl = devm_platform_get_and_ioremap_resource(pdev, 1, &ctl);
+ if (IS_ERR(ixpp->ctl))
+ return PTR_ERR(ixpp->ctl);
irq = platform_get_irq(pdev, 0);
- if (irq > 0)
- irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
- else if (irq < 0)
+ if (irq < 0)
return irq;
- else
- return -EINVAL;
+ irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
/* Just one port to set up */
ixp4xx_setup_port(ixpp->host->ports[0], ixpp, cmd->start, ctl->start);
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 7/8] ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
` (4 preceding siblings ...)
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 18:02 ` Linus Walleij
2023-07-06 21:19 ` Sergey Shtylyov
2023-07-06 12:42 ` Yangtao Li
6 siblings, 2 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Sergey Shtylyov, Linus Walleij, Damien Le Moal
Cc: Yangtao Li, linux-ide, linux-kernel
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 <frank.li@vivo.com>
---
drivers/ata/pata_ftide010.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/ata/pata_ftide010.c b/drivers/ata/pata_ftide010.c
index 6f6734c09b11..c6f60f1a908f 100644
--- a/drivers/ata/pata_ftide010.c
+++ b/drivers/ata/pata_ftide010.c
@@ -470,11 +470,7 @@ static int pata_ftide010_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENODEV;
-
- ftide->base = devm_ioremap_resource(dev, res);
+ ftide->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(ftide->base))
return PTR_ERR(ftide->base);
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-06 12:42 ` Yangtao Li
2023-07-06 12:42 ` [PATCH 3/8] ata: ahci_xgene: " Yangtao Li
` (5 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: Yangtao Li, linux-ide, linux-arm-kernel, linux-kernel
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 <frank.li@vivo.com>
---
drivers/ata/pata_imx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 4013f28679a9..65d09ec94c12 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -164,8 +164,7 @@ static int pata_imx_probe(struct platform_device *pdev)
ap->pio_mask = ATA_PIO4;
ap->flags |= ATA_FLAG_SLAVE_POSS;
- io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
+ priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
if (IS_ERR(priv->host_regs)) {
ret = PTR_ERR(priv->host_regs);
goto err;
--
2.39.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-06 12:42 ` Yangtao Li
0 siblings, 0 replies; 21+ messages in thread
From: Yangtao Li @ 2023-07-06 12:42 UTC (permalink / raw)
To: Sergey Shtylyov, Damien Le Moal, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: Yangtao Li, linux-ide, linux-arm-kernel, linux-kernel
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 <frank.li@vivo.com>
---
drivers/ata/pata_imx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 4013f28679a9..65d09ec94c12 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -164,8 +164,7 @@ static int pata_imx_probe(struct platform_device *pdev)
ap->pio_mask = ATA_PIO4;
ap->flags |= ATA_FLAG_SLAVE_POSS;
- io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
+ priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
if (IS_ERR(priv->host_regs)) {
ret = PTR_ERR(priv->host_regs);
goto err;
--
2.39.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 5/8] ata: sata_rcar: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
@ 2023-07-06 13:05 ` Geert Uytterhoeven
2023-07-06 21:10 ` Sergey Shtylyov
2023-07-06 23:37 ` Damien Le Moal
2 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2023-07-06 13:05 UTC (permalink / raw)
To: Yangtao Li
Cc: Sergey Shtylyov, Damien Le Moal, linux-ide, linux-renesas-soc,
linux-kernel
Hi Yangtao,
On Thu, Jul 6, 2023 at 2:44 PM Yangtao Li <frank.li@vivo.com> wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Thanks for your patch!
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -861,15 +861,11 @@ static int sata_rcar_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct ata_host *host;
> struct sata_rcar_priv *priv;
> - struct resource *mem;
> - int irq;
> - int ret = 0;
> + int irq, ret;
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
> - if (!irq)
> - return -EINVAL;
Why this change?
It is not documented in the patch description.
>
> priv = devm_kzalloc(dev, sizeof(struct sata_rcar_priv), GFP_KERNEL);
> if (!priv)
> @@ -890,8 +886,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
>
> host->private_data = priv;
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->base = devm_ioremap_resource(dev, mem);
> + priv->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(priv->base)) {
> ret = PTR_ERR(priv->base);
> goto err_pm_put;
The rest LGTM.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/8] ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` [PATCH 7/8] ata: pata_ftide010: " Yangtao Li
@ 2023-07-06 18:02 ` Linus Walleij
2023-07-06 21:19 ` Sergey Shtylyov
1 sibling, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2023-07-06 18:02 UTC (permalink / raw)
To: Yangtao Li; +Cc: Sergey Shtylyov, Damien Le Moal, linux-ide, linux-kernel
On Thu, Jul 6, 2023 at 2:43 PM Yangtao Li <frank.li@vivo.com> 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 <frank.li@vivo.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 5/8] ata: sata_rcar: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
2023-07-06 13:05 ` Geert Uytterhoeven
@ 2023-07-06 21:10 ` Sergey Shtylyov
2023-07-06 23:37 ` Damien Le Moal
2 siblings, 0 replies; 21+ messages in thread
From: Sergey Shtylyov @ 2023-07-06 21:10 UTC (permalink / raw)
To: Yangtao Li, Damien Le Moal; +Cc: linux-ide, linux-renesas-soc, linux-kernel
On 7/6/23 3:42 PM, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/sata_rcar.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index 34790f15c1b8..63f8337c2a98 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -861,15 +861,11 @@ static int sata_rcar_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct ata_host *host;
> struct sata_rcar_priv *priv;
> - struct resource *mem;
> - int irq;
> - int ret = 0;
> + int irq, ret;
This unneeded init of ret should be in a separate patch.
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
> - if (!irq)
> - return -EINVAL;
This is a separate issue too. I thought I've removed this myself
but apparently not, the commit [1] took shamefully long time to merge... :-(
[...]
> @@ -890,8 +886,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
>
> host->private_data = priv;
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->base = devm_ioremap_resource(dev, mem);
> + priv->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(priv->base)) {
> ret = PTR_ERR(priv->base);
> goto err_pm_put;
The (documented) change looks OK.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce753ad1549cbe9ccaea4c06a1f5fa47432c8289
MBR, Seregy
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/8] ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` [PATCH 7/8] ata: pata_ftide010: " Yangtao Li
2023-07-06 18:02 ` Linus Walleij
@ 2023-07-06 21:19 ` Sergey Shtylyov
1 sibling, 0 replies; 21+ messages in thread
From: Sergey Shtylyov @ 2023-07-06 21:19 UTC (permalink / raw)
To: Yangtao Li, Linus Walleij, Damien Le Moal; +Cc: linux-ide, linux-kernel
On 7/6/23 3:42 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 <frank.li@vivo.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` Yangtao Li
@ 2023-07-06 21:21 ` Sergey Shtylyov
-1 siblings, 0 replies; 21+ messages in thread
From: Sergey Shtylyov @ 2023-07-06 21:21 UTC (permalink / raw)
To: Yangtao Li, Damien Le Moal, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
On 7/6/23 3:42 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 <frank.li@vivo.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-06 21:21 ` Sergey Shtylyov
0 siblings, 0 replies; 21+ messages in thread
From: Sergey Shtylyov @ 2023-07-06 21:21 UTC (permalink / raw)
To: Yangtao Li, Damien Le Moal, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
On 7/6/23 3:42 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 <frank.li@vivo.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 4/8] ahci: tegra: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 ` [PATCH 4/8] ahci: tegra: " Yangtao Li
@ 2023-07-06 23:35 ` Damien Le Moal
0 siblings, 0 replies; 21+ messages in thread
From: Damien Le Moal @ 2023-07-06 23:35 UTC (permalink / raw)
To: Yangtao Li, Thierry Reding, Jonathan Hunter
Cc: linux-ide, linux-tegra, linux-kernel
On 7/6/23 21:42, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
Please be consistent with the patch titles. This should be:
ata: ahci_tegra: Convert to devm_platform_ioremap_resource()
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/ahci_tegra.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
> index 21c20793e517..d1a35da7e824 100644
> --- a/drivers/ata/ahci_tegra.c
> +++ b/drivers/ata/ahci_tegra.c
> @@ -530,8 +530,7 @@ static int tegra_ahci_probe(struct platform_device *pdev)
> tegra->pdev = pdev;
> tegra->soc = of_device_get_match_data(&pdev->dev);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res);
> + tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(tegra->sata_regs))
> return PTR_ERR(tegra->sata_regs);
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 5/8] ata: sata_rcar: Convert to devm_platform_ioremap_resource()
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
2023-07-06 13:05 ` Geert Uytterhoeven
2023-07-06 21:10 ` Sergey Shtylyov
@ 2023-07-06 23:37 ` Damien Le Moal
2 siblings, 0 replies; 21+ messages in thread
From: Damien Le Moal @ 2023-07-06 23:37 UTC (permalink / raw)
To: Yangtao Li, Sergey Shtylyov; +Cc: linux-ide, linux-renesas-soc, linux-kernel
On 7/6/23 21:42, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/sata_rcar.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
> index 34790f15c1b8..63f8337c2a98 100644
> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -861,15 +861,11 @@ static int sata_rcar_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct ata_host *host;
> struct sata_rcar_priv *priv;
> - struct resource *mem;
> - int irq;
> - int ret = 0;
> + int irq, ret;
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
> - if (!irq)
> - return -EINVAL;
Same comment as Geert: this is OK to remove, but make that a different
patch.
>
> priv = devm_kzalloc(dev, sizeof(struct sata_rcar_priv), GFP_KERNEL);
> if (!priv)
> @@ -890,8 +886,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
>
> host->private_data = priv;
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->base = devm_ioremap_resource(dev, mem);
> + priv->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(priv->base)) {
> ret = PTR_ERR(priv->base);
> goto err_pm_put;
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-06 23:39 ` Damien Le Moal
2023-07-07 18:58 ` Sergey Shtylyov
1 sibling, 0 replies; 21+ messages in thread
From: Damien Le Moal @ 2023-07-06 23:39 UTC (permalink / raw)
To: Yangtao Li, Sergey Shtylyov; +Cc: linux-ide, linux-kernel
On 7/6/23 21:42, 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.
Patch title:
ata: pata_ixp4xx: ...
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/pata_ixp4xx_cf.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
> index b1daa4d3fcd9..246bb4f8f1f7 100644
> --- a/drivers/ata/pata_ixp4xx_cf.c
> +++ b/drivers/ata/pata_ixp4xx_cf.c
> @@ -242,12 +242,6 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
> int ret;
> int irq;
>
> - cmd = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - ctl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -
> - if (!cmd || !ctl)
> - return -EINVAL;
> -
> ixpp = devm_kzalloc(dev, sizeof(*ixpp), GFP_KERNEL);
> if (!ixpp)
> return -ENOMEM;
> @@ -271,18 +265,18 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - ixpp->cmd = devm_ioremap_resource(dev, cmd);
> - ixpp->ctl = devm_ioremap_resource(dev, ctl);
> - if (IS_ERR(ixpp->cmd) || IS_ERR(ixpp->ctl))
> - return -ENOMEM;
> + ixpp->cmd = devm_platform_get_and_ioremap_resource(pdev, 0, &cmd);
> + if (IS_ERR(ixpp->cmd))
> + return PTR_ERR(ixpp->cmd);
> +
> + ixpp->ctl = devm_platform_get_and_ioremap_resource(pdev, 1, &ctl);
> + if (IS_ERR(ixpp->ctl))
> + return PTR_ERR(ixpp->ctl);
>
> irq = platform_get_irq(pdev, 0);
> - if (irq > 0)
> - irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
> - else if (irq < 0)
> + if (irq < 0)
> return irq;
> - else
> - return -EINVAL;
> + irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
This change is OK but this should be a different patch.
>
> /* Just one port to set up */
> ixp4xx_setup_port(ixpp->host->ports[0], ixpp, cmd->start, ctl->start);
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` Yangtao Li
@ 2023-07-06 23:40 ` Damien Le Moal
-1 siblings, 0 replies; 21+ messages in thread
From: Damien Le Moal @ 2023-07-06 23:40 UTC (permalink / raw)
To: Yangtao Li, Sergey Shtylyov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
On 7/6/23 21:42, 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.
Patch title:
ata: pata_imx: ...
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/pata_imx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index 4013f28679a9..65d09ec94c12 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -164,8 +164,7 @@ static int pata_imx_probe(struct platform_device *pdev)
> ap->pio_mask = ATA_PIO4;
> ap->flags |= ATA_FLAG_SLAVE_POSS;
>
> - io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
> + priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
> if (IS_ERR(priv->host_regs)) {
> ret = PTR_ERR(priv->host_regs);
> goto err;
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 8/8] pata: imx: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-06 23:40 ` Damien Le Moal
0 siblings, 0 replies; 21+ messages in thread
From: Damien Le Moal @ 2023-07-06 23:40 UTC (permalink / raw)
To: Yangtao Li, Sergey Shtylyov, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
On 7/6/23 21:42, 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.
Patch title:
ata: pata_imx: ...
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/ata/pata_imx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index 4013f28679a9..65d09ec94c12 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -164,8 +164,7 @@ static int pata_imx_probe(struct platform_device *pdev)
> ap->pio_mask = ATA_PIO4;
> ap->flags |= ATA_FLAG_SLAVE_POSS;
>
> - io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
> + priv->host_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &io_res);
> if (IS_ERR(priv->host_regs)) {
> ret = PTR_ERR(priv->host_regs);
> goto err;
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 23:39 ` Damien Le Moal
@ 2023-07-07 18:58 ` Sergey Shtylyov
1 sibling, 0 replies; 21+ messages in thread
From: Sergey Shtylyov @ 2023-07-07 18:58 UTC (permalink / raw)
To: Yangtao Li, Damien Le Moal; +Cc: linux-ide, linux-kernel
On 7/6/23 3:42 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 <frank.li@vivo.com>
> ---
> drivers/ata/pata_ixp4xx_cf.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
> index b1daa4d3fcd9..246bb4f8f1f7 100644
> --- a/drivers/ata/pata_ixp4xx_cf.c
> +++ b/drivers/ata/pata_ixp4xx_cf.c
[...]
> @@ -271,18 +265,18 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - ixpp->cmd = devm_ioremap_resource(dev, cmd);
> - ixpp->ctl = devm_ioremap_resource(dev, ctl);
> - if (IS_ERR(ixpp->cmd) || IS_ERR(ixpp->ctl))
> - return -ENOMEM;
> + ixpp->cmd = devm_platform_get_and_ioremap_resource(pdev, 0, &cmd);
> + if (IS_ERR(ixpp->cmd))
> + return PTR_ERR(ixpp->cmd);
> +
> + ixpp->ctl = devm_platform_get_and_ioremap_resource(pdev, 1, &ctl);
> + if (IS_ERR(ixpp->ctl))
> + return PTR_ERR(ixpp->ctl);
Looks good...
>
> irq = platform_get_irq(pdev, 0);
> - if (irq > 0)
> - irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
> - else if (irq < 0)
> + if (irq < 0)
> return irq;
> - else
> - return -EINVAL;
> + irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
This change also looks good (but undescribed!), however it should be
done in a separate patch.
For the future, try to follow a simple rule: do one thing per patch.
Oh, and don't forget to describe everything you do in a patch...
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2023-07-07 18:58 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 12:42 [PATCH 1/8] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 12:42 ` [PATCH 2/8] ata: ahci_seattle: " Yangtao Li
2023-07-06 12:42 ` [PATCH 3/8] ata: ahci_xgene: " Yangtao Li
2023-07-06 12:42 ` [PATCH 4/8] ahci: tegra: " Yangtao Li
2023-07-06 23:35 ` Damien Le Moal
2023-07-06 12:42 ` [PATCH 5/8] ata: sata_rcar: " Yangtao Li
2023-07-06 13:05 ` Geert Uytterhoeven
2023-07-06 21:10 ` Sergey Shtylyov
2023-07-06 23:37 ` Damien Le Moal
2023-07-06 12:42 ` [PATCH 6/8] pata: ixp4xx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 23:39 ` Damien Le Moal
2023-07-07 18:58 ` Sergey Shtylyov
2023-07-06 12:42 ` [PATCH 7/8] ata: pata_ftide010: " Yangtao Li
2023-07-06 18:02 ` Linus Walleij
2023-07-06 21:19 ` Sergey Shtylyov
2023-07-06 12:42 ` [PATCH 8/8] pata: imx: " Yangtao Li
2023-07-06 12:42 ` Yangtao Li
2023-07-06 21:21 ` Sergey Shtylyov
2023-07-06 21:21 ` Sergey Shtylyov
2023-07-06 23:40 ` Damien Le Moal
2023-07-06 23:40 ` Damien Le Moal
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.