2023-07-07 10:19:39

by 李扬韬

[permalink] [raw]
Subject: [PATCH v2 01/11] ata: ahci_octeon: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
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



2023-07-07 10:19:42

by 李扬韬

[permalink] [raw]
Subject: [PATCH v2 07/11] ata: sata_rcar: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 43c55ac89daa..63f8337c2a98 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -861,7 +861,6 @@ 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, ret;

irq = platform_get_irq(pdev, 0);
@@ -887,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


2023-07-07 10:22:09

by 李扬韬

[permalink] [raw]
Subject: [PATCH v2 09/11] ata: pata_ixp4xx: Remove unnecessary return value check

As commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0
is invalid") says, there is no need to check if the platform_get_irq
return value is 0. Let's remove it.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/ata/pata_ixp4xx_cf.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 1b9f67e16864..246bb4f8f1f7 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -274,12 +274,9 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
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


2023-07-07 19:24:59

by Sergey Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v2 07/11] ata: sata_rcar: Convert to devm_platform_ioremap_resource()

On 7/7/23 12:55 PM, Yangtao Li wrote:

> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>

Reviewed-by: Sergey Shtylyov <[email protected]>

[...]

MBR, Sergey

2023-07-07 19:51:08

by Sergey Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v2 09/11] ata: pata_ixp4xx: Remove unnecessary return value check

On 7/7/23 12:55 PM, Yangtao Li wrote:

> As commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0
> is invalid") says, there is no need to check if the platform_get_irq
> return value is 0. Let's remove it.

Again, you refer to a wrong coommit, you need:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce753ad1549cbe9ccaea4c06a1f5fa47432c8289

> Signed-off-by: Yangtao Li <[email protected]>

Aside from that:

Reviewed-by: Sergey Shtylyov <[email protected]>

[...]

MBR, Sergey