mmc: sunxi-mmc: convert to devm_platform_ioremap_resource
Subsystems (14)
PATCH 1/13 mmc: sunxi-mmc: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sunxi-mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sunxi-mmc.c +1 -2
@@ -1273,8 +1273,7 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,if (ret)return ret; - host->reg_base =devm_ioremap_resource (&pdev->dev, -platform_get_resource (pdev,IORESOURCE_MEM ,0 )); + host->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->reg_base))return PTR_ERR (host->reg_base);
Signature · 1 line
2.17.1
PATCH 2/13 mmc: tmio: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/tmio_mmc_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/tmio_mmc_core.c +1 -3
@@ -1109,12 +1109,10 @@ struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev, {struct tmio_mmc_host *host;struct mmc_host *mmc; -struct resource *res;void __iomem *ctl;int ret; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - ctl =devm_ioremap_resource (&pdev->dev, res); + ctl =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (ctl))return ERR_CAST (ctl);
Signature · 1 line
2.17.1
Re: [PATCH 02/13] mmc: tmio: convert to devm_platform_ioremap_resource
Quoted 3 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>
I am not a big fan of this new function, but oh well...
Tested on a Lager board (R-Car H2), SDHI gets recognized and SD cards are detected.
PATCH 3/13 mmc: meson-mx-sdio: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/meson-mx-sdio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/meson-mx-sdio.c +1 -3
@@ -638,7 +638,6 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)struct platform_device *slot_pdev;struct mmc_host *mmc;struct meson_mx_mmc_host *host; -struct resource *res;int ret, irq;u32 conf;
@@ -663,8 +662,7 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, host); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->base =devm_ioremap_resource (host->controller_dev, res); + host->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->base)) { ret =PTR_ERR (host->base); goto error_free_mmc;
Signature · 1 line
2.17.1
PATCH 4/13 mmc: sdhci-s3c: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci-s3c.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-s3c.c +1 -3
@@ -481,7 +481,6 @@ static int sdhci_s3c_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct sdhci_host *host;struct sdhci_s3c *sc; -struct resource *res;int ret, irq, ptr, clks;if (!pdev->dev.platform_data && !pdev->dev.of_node) {
@@ -555,8 +554,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) goto err_no_busclks; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->ioaddr =devm_ioremap_resource (&pdev->dev, res); + host->ioaddr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->ioaddr)) { ret =PTR_ERR (host->ioaddr); goto err_req_regs;
Signature · 1 line
2.17.1
PATCH 5/13 mmc: sdhci-spear: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci-spear.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-spear.c +1 -3
@@ -43,7 +43,6 @@ static const struct sdhci_ops sdhci_pltfm_ops = {static int sdhci_probe (struct platform_device *pdev) {struct sdhci_host *host; -struct resource *iomem;struct spear_sdhci *sdhci;struct device *dev;int ret;
@@ -56,8 +55,7 @@ static int sdhci_probe(struct platform_device *pdev) goto err; } - iomem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->ioaddr =devm_ioremap_resource (&pdev->dev, iomem); + host->ioaddr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->ioaddr)) { ret =PTR_ERR (host->ioaddr);dev_dbg (&pdev->dev,"unable to map iomem: %d\n" , ret);
Signature · 1 line
2.17.1
PATCH 6/13 mmc: sh_mmcif: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sh_mmcif.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sh_mmcif.c +1 -3
@@ -1388,7 +1388,6 @@ static int sh_mmcif_probe(struct platform_device *pdev)struct sh_mmcif_host *host;struct device *dev = &pdev->dev;struct sh_mmcif_plat_data *pd = dev->platform_data; -struct resource *res;void __iomem *reg;const char *name;
@@ -1397,8 +1396,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)if (irq[0 ] <0 )return -ENXIO ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - reg =devm_ioremap_resource (dev, res); + reg =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (reg))return PTR_ERR (reg);
Signature · 1 line
2.17.1
Re: [PATCH 06/13] mmc: sh_mmcif: convert to devm_platform_ioremap_resource
Quoted 3 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>
Tested on a Lager board (R-Car H2), MMCIF gets recognized and the eMMC is detected.
PATCH 7/13 mmc: sdhci_f_sdh30: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci_f_sdh30.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +1 -3
@@ -89,7 +89,6 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) {struct sdhci_host *host;struct device *dev = &pdev->dev; -struct resource *res;int irq, ctrl =0 , ret =0 ;struct f_sdhost_priv *priv;u32 reg =0 ;
@@ -123,8 +122,7 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) host->ops = &sdhci_f_sdh30_ops; host->irq = irq; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->ioaddr =devm_ioremap_resource (&pdev->dev, res); + host->ioaddr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->ioaddr)) { ret =PTR_ERR (host->ioaddr); goto err;
Signature · 1 line
2.17.1
PATCH 8/13 mmc: sdhci_am654: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci_am654.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci_am654.c +1 -3
@@ -491,7 +491,6 @@ static int sdhci_am654_probe(struct platform_device *pdev)struct sdhci_am654_data *sdhci_am654;const struct of_device_id *match;struct sdhci_host *host; -struct resource *res;struct clk *clk_xin;struct device *dev = &pdev->dev;void __iomem *base;
@@ -524,8 +523,7 @@ static int sdhci_am654_probe(struct platform_device *pdev) goto pm_runtime_disable; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - base =devm_ioremap_resource (dev, res); + base =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (base)) { ret =PTR_ERR (base); goto pm_runtime_put;
Signature · 1 line
2.17.1
PATCH 9/13 mmc: sdhci-milbeaut: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci-milbeaut.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-milbeaut.c +1 -3
@@ -242,7 +242,6 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) {struct sdhci_host *host;struct device *dev = &pdev->dev; -struct resource *res;int irq, ret =0 ;struct f_sdhost_priv *priv;
@@ -280,8 +279,7 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) host->ops = &sdhci_milbeaut_ops; host->irq = irq; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->ioaddr =devm_ioremap_resource (&pdev->dev, res); + host->ioaddr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->ioaddr)) { ret =PTR_ERR (host->ioaddr); goto err;
Signature · 1 line
2.17.1
PATCH 10/13 mmc: sdhci-msm: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/sdhci-msm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/sdhci-msm.c +1 -4
@@ -1746,7 +1746,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct sdhci_msm_host *msm_host; -struct resource *core_memres;struct clk *clk;int ret;u16 host_version, core_minor;
@@ -1847,9 +1846,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) }if (!msm_host->mci_removed) { - core_memres =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - msm_host->core_mem =devm_ioremap_resource (&pdev->dev, - core_memres); + msm_host->core_mem =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (msm_host->core_mem)) { ret =PTR_ERR (msm_host->core_mem);
Signature · 1 line
2.17.1
Re: [PATCH 10/13] mmc: sdhci-msm: convert to devm_platform_ioremap_resource
Quoted 20 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>--- drivers/mmc/host/sdhci-msm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mmc/host/sdhci-msm.c +0
-1@@ -1746,7 +1746,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct sdhci_msm_host *msm_host; -struct resource *core_memres;struct clk *clk;int ret;u16 host_version, core_minor;
drivers/mmc/host/sdhci-msm.c static int sdhci_msm_probe(struct platform_device *pdev) · line 1850
Quoted 8 lines
drivers/mmc/host/sdhci-msm.c +1
-3@@ -1847,9 +1846,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) }if (!msm_host->mci_removed) { - core_memres =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - msm_host->core_mem =devm_ioremap_resource (&pdev->dev, - core_memres); + msm_host->core_mem =devm_platform_ioremap_resource (pdev,1 );
This would now look better without this empty line.
Regards,
Bjorn
Quoted 5 lines
drivers/mmc/host/sdhci-msm.c +0
-0if (IS_ERR (msm_host->core_mem)) { ret =PTR_ERR (msm_host->core_mem);Signature · 1 line
2.17.1
Re: [PATCH 10/13] mmc: sdhci-msm: convert to devm_platform_ioremap_resource
-trimmed cc list
Quoted 25 lines · Bjorn Andersson
Quoted 22 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>--- drivers/mmc/host/sdhci-msm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mmc/host/sdhci-msm.c +0
-1@@ -1746,7 +1746,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct sdhci_msm_host *msm_host; -struct resource *core_memres;struct clk *clk;int ret;u16 host_version, core_minor;@@ -1847,9 +1846,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) }
Quoted 8 lines
drivers/mmc/host/sdhci-msm.c static int sdhci_msm_probe(struct platform_device *pdev) · line 1850
Quoted 6 lines
drivers/mmc/host/sdhci-msm.c +1
-3if (!msm_host->mci_removed) { - core_memres =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - msm_host->core_mem =devm_ioremap_resource (&pdev->dev, - core_memres); + msm_host->core_mem =devm_platform_ioremap_resource (pdev,1 );This would now look better without this empty line.
Good point, I fixed it when applying. No actions needed.
Quoted 3 lines
Reviewed-by Bjorn Andersson <[email protected]>
[...]
Kind regards
Uffe
PATCH 11/13 mmc: mvsdio: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/mvsdio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/mvsdio.c +2 -4
@@ -696,16 +696,14 @@ static int mvsd_probe(struct platform_device *pdev)struct mmc_host *mmc =NULL ;struct mvsd_host *host =NULL ;const struct mbus_dram_target_info *dram; -struct resource *r;int ret, irq;if (!np) {dev_err (&pdev->dev,"no DT node\n" );return -ENODEV ; } - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); irq =platform_get_irq (pdev,0 ); -if (!r || irq <0 ) +if (irq <0 )return -ENXIO ; mmc =mmc_alloc_host (sizeof (struct mvsd_host ), &pdev->dev);
@@ -758,7 +756,7 @@ static int mvsd_probe(struct platform_device *pdev)spin_lock_init (&host->lock); - host->base =devm_ioremap_resource (&pdev->dev, r); + host->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->base)) { ret =PTR_ERR (host->base); goto out;
Signature · 1 line
2.17.1
PATCH 12/13 mmc: mtk-sd: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/mmc/host/mtk-sd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/mtk-sd.c +1 -2
@@ -2194,8 +2194,7 @@ static int msdc_drv_probe(struct platform_device *pdev)if (ret) goto host_free; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - host->base =devm_ioremap_resource (&pdev->dev, res); + host->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->base)) { ret =PTR_ERR (host->base); goto host_free;
Signature · 1 line
2.17.1
PATCH 13/13 mmc: au1xmmc: switch to platform_get_irq
In reply to Yangtao Liplatform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for requesting IRQ's resources, as they can be not ready yet. Using platform_get_irq() instead is preferred for getting IRQ even if it was not retrieved earlier.
--- drivers/mmc/host/au1xmmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/host/au1xmmc.c +2 -5
@@ -984,12 +984,9 @@ static int au1xmmc_probe(struct platform_device *pdev) goto out2; } - r =platform_get_resource (pdev,IORESOURCE_IRQ ,0 ); -if (!r) { -dev_err (&pdev->dev,"no IRQ defined\n" ); + host->irq =platform_get_irq (pdev,0 ); +if (host->irq <0 ) goto out3; - } - host->irq = r->start; mmc->ops = &au1xmmc_ops;
Signature · 1 line
2.17.1
Re: [PATCH 13/13] mmc: au1xmmc: switch to platform_get_irq
- trimmed cc list (please do that also for any future submissions).
Quoted 7 lines · Yangtao Li
platform_get_resource(pdev, IORESOURCE_IRQ)is not recommended for requesting IRQ's resources, as they can be not ready yet. Usingplatform_get_irq()instead is preferred for getting IRQ even if it was not retrieved earlier.Signed-off-by Yangtao Li <[email protected]>
Patch 1->13 applied for next, thanks!
Next time, please use a cover-letter when you send a series.
Kind regards
Uffe
Quoted 26 lines
--- drivers/mmc/host/au1xmmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/mmc/host/au1xmmc.c +2
-6@@ -984,12 +984,9 @@ static int au1xmmc_probe(struct platform_device *pdev) goto out2; } - r =platform_get_resource (pdev,IORESOURCE_IRQ ,0 ); -if (!r) { -dev_err (&pdev->dev,"no IRQ defined\n" ); + host->irq =platform_get_irq (pdev,0 ); +if (host->irq <0 ) goto out3; - } - host->irq = r->start; mmc->ops = &au1xmmc_ops; --2.17.1
Quoted 5 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>---
Quoted 20 lines
drivers/mmc/host/sunxi-mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mmc/host/sunxi-mmc.c +1
-3@@ -1273,8 +1273,7 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,if (ret)return ret; - host->reg_base =devm_ioremap_resource (&pdev->dev, -platform_get_resource (pdev,IORESOURCE_MEM ,0 )); + host->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (host->reg_base))return PTR_ERR (host->reg_base); --2.17.1