ata: ahci_octeon: Convert to devm_platform_ioremap_resource()
Subsystems (6)
PATCH v3 1/11 ata: ahci_octeon: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/ata/ahci_octeon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/ata/ahci_octeon.c +1 -3
@@ -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);
Signature · 1 line
2.39.0
PATCH v3 2/11 ata: ahci_seattle: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/ata/ahci_seattle.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ata/ahci_seattle.c +1 -2
@@ -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;
Signature · 1 line
2.39.0
PATCH v3 3/11 ata: ahci_xgene: Convert to devm_platform_ioremap_resource()
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/ata/ahci_xgene.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/ata/ahci_xgene.c +3 -6
@@ -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);
Signature · 1 line
2.39.0
PATCH v3 4/11 ata: ahci_tegra: Convert to devm_platform_ioremap_resource()
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/ata/ahci_tegra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ata/ahci_tegra.c +1 -2
@@ -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);
Signature · 1 line
2.39.0
PATCH v3 5/11 ata: sata_rcar: drop useless initializer
In reply to Yangtao LiThere is no need to initialize the variable ret.
--- drivers/ata/sata_rcar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ata/sata_rcar.c +1 -2
@@ -862,8 +862,7 @@ static int sata_rcar_probe(struct platform_device *pdev)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 )
Signature · 1 line
2.39.0
Re: [PATCH v3 05/11] ata: sata_rcar: drop useless initializer
Quoted 4 lines · Yangtao Li
There is no need to initialize the variable ret.
Signed-off-by Yangtao Li <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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
PATCH v3 6/11 ata: sata_rcar: Remove unnecessary return value check
In reply to Yangtao LiAs commit ce753ad1549c ("platform: finally disallow IRQ0 in platform_get_irq() and its ilk") says, there is no need to check if the platform_get_irq return value is 0. Let's remove it.
--- drivers/ata/sata_rcar.c | 2 -- 1 file changed, 2 deletions(-)
drivers/ata/sata_rcar.c +0 -2
@@ -867,8 +867,6 @@ static int sata_rcar_probe(struct platform_device *pdev) 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)
Signature · 1 line
2.39.0
Re: [PATCH v3 06/11] ata: sata_rcar: Remove unnecessary return value check
Quoted 6 lines · Yangtao Li
As commit
ce753ad1549c("platform: finally disallow IRQ0 inplatform_get_irq()and its ilk") says, there is no need to check if theplatform_get_irqreturn value is 0. Let's remove it.Signed-off-by Yangtao Li <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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
PATCH v3 7/11 ata: sata_rcar: Convert to devm_platform_ioremap_resource()
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/ata/sata_rcar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/ata/sata_rcar.c +1 -3
@@ -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;
Signature · 1 line
2.39.0
Re: [PATCH v3 07/11] ata: sata_rcar: Convert to devm_platform_ioremap_resource()
Quoted 4 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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
PATCH v3 8/11 ata: pata_ixp4xx: Use devm_platform_get_and_ioremap_resource()
In reply to Yangtao LiConvert 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.
--- drivers/ata/pata_ixp4xx_cf.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/ata/pata_ixp4xx_cf.c +7 -10
@@ -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,10 +265,13 @@ 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 )
Signature · 1 line
2.39.0
PATCH v3 9/11 ata: pata_ixp4xx: Remove unnecessary return value check
In reply to Yangtao LiAs commit ce753ad1549c ("platform: finally disallow IRQ0 in platform_get_irq() and its ilk") says, there is no need to check if the platform_get_irq return value is 0. Let's remove it.
--- drivers/ata/pata_ixp4xx_cf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ata/pata_ixp4xx_cf.c +2 -5
@@ -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);
Signature · 1 line
2.39.0
PATCH v3 10/11 ata: pata_ftide010: Use devm_platform_get_and_ioremap_resource()
In reply to Yangtao LiConvert 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.
--- drivers/ata/pata_ftide010.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/ata/pata_ftide010.c +1 -5
@@ -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);
Signature · 1 line
2.39.0
PATCH v3 11/11 ata: pata_imx: Use devm_platform_get_and_ioremap_resource()
In reply to Yangtao LiConvert 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.
--- drivers/ata/pata_imx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ata/pata_imx.c +1 -2
@@ -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;
Signature · 7 lines
2.39.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 3 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>
Applied the series to for-6.6. Thanks !
(next time, please add a cover letter for a multi-patch series)
Signature · 2 lines
Damien Le Moal Western Digital Research