mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage
Subsystems (30)
v3 cover mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage
Hi all:
After the first part of the cleanup[1], there are sdhci related drivers that need further cleanup.
This patchset is the second part of the cleanup series, and since sdhci has sdhci_alloc_host() as the general interface, our main job is to clean up sdhci_pltfm_free() and sdhci_free_host().
[1]: https://lore.kernel.org/all/[email protected]/
Thanks.
-----
V3:
- Collect Reviewed-by and Acked-by tags.
Patch-19:
- Use dev_err_probe() to cleanup the code.
Patch-32:
- Fix build warning by lkp:
https://lore.kernel.org/all/[email protected]/
Link to V2:
https://lore.kernel.org/all/[email protected]/
V2:
- Collect Reviewed-by and Acked-by tags.
Patch-01:
- Set sdhci_free_host() to empty, rather than dropping it.
Patch-07:
- Set sdhci_pltfm_free() to empty, rather than dropping it.
Patch-22:
- As requested by Yixun, retain the goto scheme.
Patch-35:
- New patch;
- Since all calls have been cleaned up, sdhci_pltfm_free()/sdhci_free_host() are now dropped directly;
Link to V1:
https://lore.kernel.org/all/[email protected]/
Binbin Zhou (35):
mmc: sdhci: Use devm_mmc_alloc_host() helper
mmc: sdhci-acpi: Drop the use of sdhci_free_host()
mmc: sdhci-milbeaut: Drop the use of sdhci_free_host()
mmc: sdhci-pci: Drop the use of sdhci_free_host()
mmc: sdhci-s3c: Drop the use of sdhci_free_host()
mmc: sdhci-spear: Drop the use of sdhci_free_host()
mmc: sdhci-pltfm: Drop the use of sdhci_pltfm_free()
mmc: sdhci-bcm-kona: Drop the use of sdhci_pltfm_free()
mmc: sdhci-brcmstb: Drop the use of sdhci_pltfm_free()
mmc: sdhci-cadence: Drop the use of sdhci_pltfm_free()
mmc: sdhci-dove: Drop the use of sdhci_pltfm_free()
mmc: sdhci-esdhc-imx: Drop the use of sdhci_pltfm_free()
mmc: sdhci-esdhc-mcf: Drop the use of sdhci_pltfm_free()
mmc: sdhci-iproc: Drop the use of sdhci_pltfm_free()
mmc: sdhci-msm: Drop the use of sdhci_pltfm_free()
mmc: sdhci-npcm: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-arasan: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-dwcmshc: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-esdhc: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-ma35d1: Drop the use of sdhci_pltfm_free()
mmc: sdhci-of-sparx5: Drop the use of sdhci_pltfm_free()
mmc: sdhci-omap: Drop the use of sdhci_pltfm_free()
mmc: sdhci-pic32: Drop the use of sdhci_pltfm_free()
mmc: sdhci-pxav2: Drop the use of sdhci_pltfm_free()
mmc: sdhci-pxav3: Drop the use of sdhci_pltfm_free()
mmc: sdhci-sprd: Drop the use of sdhci_pltfm_free()
mmc: sdhci-st: Drop the use of sdhci_pltfm_free()
mmc: sdhci-tegra: Drop the use of sdhci_pltfm_free()
mmc: sdhci-xenon: Drop the use of sdhci_pltfm_free()
mmc: sdhci_am654: Drop the use of sdhci_pltfm_free()
mmc: sdhci_f_sdh30: Drop the use of sdhci_pltfm_free()
mmc: sdhci: Drop sdhci_free_host()/sdhci_pltfm_free() interface
drivers/mmc/host/sdhci-acpi.c | 3 --- drivers/mmc/host/sdhci-bcm-kona.c | 2 -- drivers/mmc/host/sdhci-brcmstb.c | 1 - drivers/mmc/host/sdhci-cadence.c | 21 ++++++------------ drivers/mmc/host/sdhci-dove.c | 12 ++--------- drivers/mmc/host/sdhci-esdhc-imx.c | 3 --- drivers/mmc/host/sdhci-esdhc-mcf.c | 25 ++++++---------------- drivers/mmc/host/sdhci-iproc.c | 18 ++++------------ drivers/mmc/host/sdhci-milbeaut.c | 19 ++++++----------- drivers/mmc/host/sdhci-msm.c | 11 ++++------ drivers/mmc/host/sdhci-npcm.c | 15 +++---------- drivers/mmc/host/sdhci-of-arasan.c | 26 +++++++---------------- drivers/mmc/host/sdhci-of-aspeed.c | 10 ++------- drivers/mmc/host/sdhci-of-at91.c | 30 ++++++++++---------------- drivers/mmc/host/sdhci-of-dwcmshc.c | 14 +++++------- drivers/mmc/host/sdhci-of-esdhc.c | 11 ++-------- drivers/mmc/host/sdhci-of-k1.c | 1 - drivers/mmc/host/sdhci-of-ma35d1.c | 23 +++++++------------- drivers/mmc/host/sdhci-of-sparx5.c | 24 +++++++-------------- drivers/mmc/host/sdhci-omap.c | 21 ++++++------------ drivers/mmc/host/sdhci-pci-core.c | 9 ++------ drivers/mmc/host/sdhci-pic32.c | 9 +++----- drivers/mmc/host/sdhci-pltfm.c | 16 +------------- drivers/mmc/host/sdhci-pltfm.h | 1 - drivers/mmc/host/sdhci-pxav2.c | 26 ++++++----------------- drivers/mmc/host/sdhci-pxav3.c | 7 +----- drivers/mmc/host/sdhci-s3c.c | 16 ++++---------- drivers/mmc/host/sdhci-spear.c | 11 ++++------ drivers/mmc/host/sdhci-sprd.c | 33 +++++++++-------------------- drivers/mmc/host/sdhci-st.c | 6 ++---- drivers/mmc/host/sdhci-tegra.c | 9 +++----- drivers/mmc/host/sdhci-xenon.c | 15 +++++-------- drivers/mmc/host/sdhci.c | 9 +------- drivers/mmc/host/sdhci.h | 1 - drivers/mmc/host/sdhci_am654.c | 20 ++++++----------- drivers/mmc/host/sdhci_f_sdh30.c | 13 ++++-------- 36 files changed, 135 insertions(+), 356 deletions(-)
base-commit: d2c6acff6386f43ed307822454b970c831c48f1b
Signature · 1 line
2.47.1
PATCH v3 1/35 mmc: sdhci: Use devm_mmc_alloc_host() helper
Use new function devm_mmc_alloc_host() to simplify the code.
Although sdhci_free_host() is no longer needed, to avoid drivers that still use this function from failing to compile, sdhci_free_host() is temporarily set to empty. Finally, it will be removed when there are no more callers.
--- drivers/mmc/host/sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +1 -2
@@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,WARN_ON (dev ==NULL ); - mmc =mmc_alloc_host (sizeof (struct sdhci_host ) + priv_size, dev); + mmc =devm_mmc_alloc_host (dev,sizeof (struct sdhci_host ) + priv_size);if (!mmc)return ERR_PTR (-ENOMEM );
@@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);void sdhci_free_host (struct sdhci_host *host) { -mmc_free_host (host->mmc); }EXPORT_SYMBOL_GPL (sdhci_free_host);
Signature · 1 line
2.47.1
Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
Quoted 25 lines · Binbin Zhou
Use new function
devm_mmc_alloc_host()to simplify the code.Although
sdhci_free_host()is no longer needed, to avoid drivers that still use this function from failing to compile,sdhci_free_host()is temporarily set to empty. Finally, it will be removed when there are no more callers.Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mmc/host/sdhci.c +1
-1@@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,WARN_ON (dev ==NULL ); - mmc =mmc_alloc_host (sizeof (struct sdhci_host ) + priv_size, dev); + mmc =devm_mmc_alloc_host (dev,sizeof (struct sdhci_host ) + priv_size);if (!mmc)return ERR_PTR (-ENOMEM );
drivers/mmc/host/sdhci.c EXPORT_SYMBOL_GPL(sdhci_remove_host); · line 5005
Quoted 5 lines
drivers/mmc/host/sdhci.c +0
-1@@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);void sdhci_free_host (struct sdhci_host *host) { -mmc_free_host (host->mmc); }
Is there any point in keeping the sdhci_free_host() function around now? I only see patches 1 and 31, so not sure if anything happens in between.
Thierry
Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
Hi Thierry:
Quoted 25 lines · Thierry Reding
Quoted 24 lines · Binbin Zhou
Use new function
devm_mmc_alloc_host()to simplify the code.Although
sdhci_free_host()is no longer needed, to avoid drivers that still use this function from failing to compile,sdhci_free_host()is temporarily set to empty. Finally, it will be removed when there are no more callers.Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mmc/host/sdhci.c +1
-1@@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,WARN_ON (dev ==NULL ); - mmc =mmc_alloc_host (sizeof (struct sdhci_host ) + priv_size, dev); + mmc =devm_mmc_alloc_host (dev,sizeof (struct sdhci_host ) + priv_size);if (!mmc)return ERR_PTR (-ENOMEM );
Quoted 8 lines
drivers/mmc/host/sdhci.c EXPORT_SYMBOL_GPL(sdhci_remove_host); · line 5005
Quoted 6 lines
drivers/mmc/host/sdhci.c +0
-1@@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);void sdhci_free_host (struct sdhci_host *host) { -mmc_free_host (host->mmc); }Is there any point in keeping the
sdhci_free_host()function around now? I only see patches 1 and 31, so not sure if anything happens in between.
To minimize email delivery failures, I handle each driver patch by sending it to the relevant person, while sending patches 0 and 1 to everyone.
Keeping sdhci_free_host() as suggested by Adrian[1] is to minimize disruption to the compilation process. We first set sdhci_free_host() to empty, and once all callers have been cleaned up, we will remove it[2].
Of course, perhaps I should also CC the final patch[2] to everyone, which would make the entire process clearer.
[1]: https://lore.kernel.org/all/[email protected]/
Thanks.
Binbin
Quoted 2 lines
Thierry
Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
Quoted 36 lines · Binbin Zhou
Hi Thierry:
Quoted 21 lines · Thierry Reding
Quoted 20 lines · Binbin Zhou
Use new function
devm_mmc_alloc_host()to simplify the code.Although
sdhci_free_host()is no longer needed, to avoid drivers that still use this function from failing to compile,sdhci_free_host()is temporarily set to empty. Finally, it will be removed when there are no more callers.Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mmc/host/sdhci.c +1
-1@@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,WARN_ON (dev ==NULL ); - mmc =mmc_alloc_host (sizeof (struct sdhci_host ) + priv_size, dev); + mmc =devm_mmc_alloc_host (dev,sizeof (struct sdhci_host ) + priv_size);if (!mmc)Quoted 8 lines
drivers/mmc/host/sdhci.c EXPORT_SYMBOL_GPL(sdhci_remove_host); · line 5004
Quoted 6 lines
drivers/mmc/host/sdhci.c +0
-1return ERR_PTR (-ENOMEM );@@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);void sdhci_free_host (struct sdhci_host *host) { -mmc_free_host (host->mmc); }Is there any point in keeping the
sdhci_free_host()function around now? I only see patches 1 and 31, so not sure if anything happens in between.To minimize email delivery failures, I handle each driver patch by sending it to the relevant person, while sending patches 0 and 1 to everyone.
Quoted 6 lines
Keeping
sdhci_free_host()as suggested by Adrian[1] is to minimize disruption to the compilation process. We first setsdhci_free_host()to empty, and once all callers have been cleaned up, we will remove it[2].Of course, perhaps I should also CC the final patch[2] to everyone, which would make the entire process clearer.
Makes sense, and no worries. There's no great solution to this. Either you send to everyone and you get complaints, or you send to too few people and you get complaints.
Thanks for clarifying.
Thierry
PATCH v3 2/35 mmc: sdhci-acpi: Drop the use of sdhci_free_host()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_free_host() is no longer needed.
--- drivers/mmc/host/sdhci-acpi.c | 3 --- 1 file changed, 3 deletions(-)
drivers/mmc/host/sdhci-acpi.c +0 -3
@@ -948,7 +948,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)if (c->slot && c->slot->free_slot) c->slot->free_slot (pdev); -sdhci_free_host (c->host);return err; }
@@ -972,8 +971,6 @@ static void sdhci_acpi_remove(struct platform_device *pdev)if (c->slot && c->slot->free_slot) c->slot->free_slot (pdev); - -sdhci_free_host (c->host); } static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed(
Signature · 1 line
2.47.1
PATCH v3 3/35 mmc: sdhci-milbeaut: Drop the use of sdhci_free_host()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_free_host() is no longer needed.
--- drivers/mmc/host/sdhci-milbeaut.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
drivers/mmc/host/sdhci-milbeaut.c +6 -13
@@ -258,7 +258,7 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto err; +return ret;platform_set_drvdata (pdev, host);
@@ -267,23 +267,19 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) host->irq = irq; host->ioaddr =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (host->ioaddr)) { - ret =PTR_ERR (host->ioaddr); - goto err; - } +if (IS_ERR (host->ioaddr)) +return PTR_ERR (host->ioaddr);if (dev_of_node (dev)) {sdhci_get_of_property (pdev); priv->clk_iface =devm_clk_get (&pdev->dev,"iface" ); -if (IS_ERR (priv->clk_iface)) { - ret =PTR_ERR (priv->clk_iface); - goto err; - } +if (IS_ERR (priv->clk_iface)) +return PTR_ERR (priv->clk_iface); ret =clk_prepare_enable (priv->clk_iface);if (ret) - goto err; +return ret; priv->clk =devm_clk_get (&pdev->dev,"core" );if (IS_ERR (priv->clk)) {
@@ -308,8 +304,6 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); err_clk:clk_disable_unprepare (priv->clk_iface); -err: -sdhci_free_host (host);return ret; }
@@ -324,7 +318,6 @@ static void sdhci_milbeaut_remove(struct platform_device *pdev)clk_disable_unprepare (priv->clk_iface);clk_disable_unprepare (priv->clk); -sdhci_free_host (host);platform_set_drvdata (pdev,NULL ); }
Signature · 1 line
2.47.1
PATCH v3 4/35 mmc: sdhci-pci: Drop the use of sdhci_free_host()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_free_host() is no longer needed.
--- drivers/mmc/host/sdhci-pci-core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +2 -7
@@ -2173,7 +2173,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( ret =pcim_iomap_regions (pdev,BIT (bar),mmc_hostname (host->mmc));if (ret) {dev_err (&pdev->dev,"cannot request region\n" ); - goto cleanup; +return ERR_PTR (ret); } host->ioaddr =pcim_iomap_table (pdev)[bar];
@@ -2181,7 +2181,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(if (chip->fixes && chip->fixes->probe_slot) { ret = chip->fixes->probe_slot (slot);if (ret) - goto cleanup; +return ERR_PTR (ret); } host->mmc->pm_caps =MMC_PM_KEEP_POWER ;
@@ -2242,9 +2242,6 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(if (chip->fixes && chip->fixes->remove_slot) chip->fixes->remove_slot (slot,0 ); -cleanup: -sdhci_free_host (host); -return ERR_PTR (ret); }
@@ -2265,8 +2262,6 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot)if (slot->chip->fixes && slot->chip->fixes->remove_slot) slot->chip->fixes->remove_slot (slot, dead); - -sdhci_free_host (slot->host); }int sdhci_pci_uhs2_add_host (struct sdhci_pci_slot *slot)
Signature · 1 line
2.47.1
PATCH v3 5/35 mmc: sdhci-s3c: Drop the use of sdhci_free_host()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_free_host() is no longer needed.
--- drivers/mmc/host/sdhci-s3c.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/mmc/host/sdhci-s3c.c +4 -12
@@ -507,15 +507,13 @@ static int sdhci_s3c_probe(struct platform_device *pdev) sc =sdhci_priv (host); pdata =devm_kzalloc (&pdev->dev,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { - ret = -ENOMEM ; - goto err_pdata_io_clk; - } +if (!pdata) +return -ENOMEM ;if (pdev->dev.of_node) { ret =sdhci_s3c_parse_dt (&pdev->dev, host, pdata);if (ret) - goto err_pdata_io_clk; +return ret; }else {memcpy (pdata, pdev->dev.platform_data,sizeof (*pdata)); }
@@ -532,8 +530,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) sc->clk_io =devm_clk_get (dev,"hsmmc" );if (IS_ERR (sc->clk_io)) {dev_err (dev,"failed to get io clock\n" ); - ret =PTR_ERR (sc->clk_io); - goto err_pdata_io_clk; +return PTR_ERR (sc->clk_io); }/* enable the local io clock and keep it running for the moment. */
@@ -661,9 +658,6 @@ static int sdhci_s3c_probe(struct platform_device *pdev) err_no_busclks:clk_disable_unprepare (sc->clk_io); - err_pdata_io_clk: -sdhci_free_host (host); -return ret; }
@@ -685,8 +679,6 @@ static void sdhci_s3c_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);clk_disable_unprepare (sc->clk_io); - -sdhci_free_host (host); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 6/35 mmc: sdhci-spear: Drop the use of sdhci_free_host()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_free_host() is no longer needed.
--- drivers/mmc/host/sdhci-spear.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/mmc/host/sdhci-spear.c +4 -7
@@ -59,7 +59,7 @@ static int sdhci_probe(struct platform_device *pdev)if (IS_ERR (host->ioaddr)) { ret =PTR_ERR (host->ioaddr);dev_dbg (&pdev->dev,"unable to map iomem: %d\n" , ret); - goto err_host; + goto err; } host->hw_name ="sdhci" ;
@@ -67,7 +67,7 @@ static int sdhci_probe(struct platform_device *pdev) host->irq =platform_get_irq (pdev,0 );if (host->irq <0 ) { ret = host->irq; - goto err_host; + goto err; } host->quirks =SDHCI_QUIRK_BROKEN_ADMA ;
@@ -78,13 +78,13 @@ static int sdhci_probe(struct platform_device *pdev)if (IS_ERR (sdhci->clk)) { ret =PTR_ERR (sdhci->clk);dev_dbg (&pdev->dev,"Error getting clock\n" ); - goto err_host; + goto err; } ret =clk_prepare_enable (sdhci->clk);if (ret) {dev_dbg (&pdev->dev,"Error enabling clock\n" ); - goto err_host; + goto err; } ret =clk_set_rate (sdhci->clk,50000000 );
@@ -110,8 +110,6 @@ static int sdhci_probe(struct platform_device *pdev) disable_clk:clk_disable_unprepare (sdhci->clk); -err_host: -sdhci_free_host (host); err:dev_err (&pdev->dev,"spear-sdhci probe failed: %d\n" , ret);return ret;
@@ -130,7 +128,6 @@ static void sdhci_remove(struct platform_device *pdev)sdhci_remove_host (host, dead);clk_disable_unprepare (sdhci->clk); -sdhci_free_host (host); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 7/35 mmc: sdhci-pltfm: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
To avoid causing drivers that still use sdhci_pltfm_free() to fail to compile, it has been temporarily set to empty. And it will be removed when there are no longer any callers.
--- drivers/mmc/host/sdhci-pltfm.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/mmc/host/sdhci-pltfm.c +1 -10
@@ -148,9 +148,6 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_init);void sdhci_pltfm_free (struct platform_device *pdev) { -struct sdhci_host *host =platform_get_drvdata (pdev); - -sdhci_free_host (host); }EXPORT_SYMBOL_GPL (sdhci_pltfm_free);
@@ -159,7 +156,6 @@ int sdhci_pltfm_init_and_add_host(struct platform_device *pdev, size_t priv_size) {struct sdhci_host *host; -int ret =0 ; host =sdhci_pltfm_init (pdev, pdata, priv_size);if (IS_ERR (host))
@@ -167,11 +163,7 @@ int sdhci_pltfm_init_and_add_host(struct platform_device *pdev,sdhci_get_property (pdev); - ret =sdhci_add_host (host); -if (ret) -sdhci_pltfm_free (pdev); - -return ret; +return sdhci_add_host (host); }EXPORT_SYMBOL_GPL (sdhci_pltfm_init_and_add_host);
@@ -181,7 +173,6 @@ void sdhci_pltfm_remove(struct platform_device *pdev)int dead = (readl (host->ioaddr +SDHCI_INT_STATUS ) ==0xffffffff );sdhci_remove_host (host, dead); -sdhci_pltfm_free (pdev); }EXPORT_SYMBOL_GPL (sdhci_pltfm_remove);
Signature · 1 line
2.47.1
PATCH v3 8/35 mmc: sdhci-bcm-kona: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-bcm-kona.c | 2 -- 1 file changed, 2 deletions(-)
drivers/mmc/host/sdhci-bcm-kona.c +0 -2
@@ -304,8 +304,6 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)clk_disable_unprepare (pltfm_priv->clk); err_pltfm_free: -sdhci_pltfm_free (pdev); -dev_err (dev,"Probing of sdhci-pltfm failed: %d\n" , ret);return ret; }
Signature · 1 line
2.47.1
PATCH v3 9/35 mmc: sdhci-brcmstb: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-brcmstb.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-brcmstb.c +0 -1
@@ -485,7 +485,6 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)return res; err: -sdhci_pltfm_free (pdev);clk_disable_unprepare (base_clk);return res; }
Signature · 1 line
2.47.1
PATCH v3 10/35 mmc: sdhci-cadence: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-cadence.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
drivers/mmc/host/sdhci-cadence.c +6 -15
@@ -515,7 +515,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)if (data->init) { ret = data->init (pdev);if (ret) - goto free; +return ret; }sdhci_enable_v4_mode (host);__sdhci_read_caps (host, &version,NULL ,NULL );
@@ -524,33 +524,24 @@ static int sdhci_cdns_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto free; +return ret;sdhci_cdns_phy_param_parse (dev->of_node, priv); ret =sdhci_cdns_phy_init (priv);if (ret) - goto free; +return ret;if (host->mmc->caps &MMC_CAP_HW_RESET ) { priv->rst_hw =devm_reset_control_get_optional_exclusive (dev,NULL ); -if (IS_ERR (priv->rst_hw)) { - ret =dev_err_probe (mmc_dev (host->mmc),PTR_ERR (priv->rst_hw), +if (IS_ERR (priv->rst_hw)) +return dev_err_probe (mmc_dev (host->mmc),PTR_ERR (priv->rst_hw),"reset controller error\n" ); - goto free; - }if (priv->rst_hw) host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset; } - ret =sdhci_add_host (host); -if (ret) - goto free; - -return 0 ; -free: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 11/35 mmc: sdhci-dove: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-dove.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-dove.c +2 -10
@@ -79,17 +79,9 @@ static int sdhci_dove_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto err_sdhci_add; +return ret; - ret =sdhci_add_host (host); -if (ret) - goto err_sdhci_add; - -return 0 ; - -err_sdhci_add: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }static const struct of_device_id sdhci_dove_of_match_table[] = {
Signature · 1 line
2.47.1
PATCH v3 12/35 mmc: sdhci-esdhc-imx: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-esdhc-imx.c | 3 --- 1 file changed, 3 deletions(-)
drivers/mmc/host/sdhci-esdhc-imx.c +0 -3
@@ -1973,7 +1973,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) free_sdhci:if (imx_data->socdata->flags &ESDHC_FLAG_PMQOS )cpu_latency_qos_remove_request (&imx_data->pm_qos_req); -sdhci_pltfm_free (pdev);return err; }
@@ -1997,8 +1996,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device *pdev)if (imx_data->socdata->flags &ESDHC_FLAG_PMQOS )cpu_latency_qos_remove_request (&imx_data->pm_qos_req); - -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
RE: [PATCH v3 12/35] mmc: sdhci-esdhc-imx: Drop the use of sdhci_pltfm_free()
Quoted 14 lines
-----Original Message-----
From: Binbin Zhou <[email protected]>
Sent: 2025年6月7日 15:37
To: Binbin Zhou <[email protected]>; Huacai Chen <[email protected]>; Ulf Hansson <[email protected]>; Adrian Hunter <[email protected]>
Cc: Huacai Chen <[email protected]>; [email protected]; Andrew Jeffery <[email protected]>; Binbin Zhou <[email protected]>; Bough Chen <[email protected]>; Shawn Guo <[email protected]>; Sascha Hauer <[email protected]>; Fabio Estevam <[email protected]>; [email protected]
Subject: [PATCH v3 12/35] mmc: sdhci-esdhc-imx: Drop the use ofsdhci_pltfm_free()
Quoted 2 lines
Since the
devm_mmc_alloc_host()helper is already in use,sdhci_pltfm_free()is no longer needed.
Regards
Haibo chen
Quoted 37 lines
Cc Haibo Chen <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Fabio Estevam <[email protected]>Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci-esdhc-imx.c | 3 --- 1 file changed, 3 deletions(-)drivers/mmc/host/sdhci-esdhc-imx.c +0
-3@@ -1973,7 +1973,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) free_sdhci:if (imx_data->socdata->flags &ESDHC_FLAG_PMQOS )cpu_latency_qos_remove_request (&imx_data->pm_qos_req); -sdhci_pltfm_free (pdev);return err; }@@ -1997,8 +1996,6 @@ static void sdhci_esdhc_imx_remove(struct platform_device *pdev)if (imx_data->socdata->flags &ESDHC_FLAG_PMQOS )cpu_latency_qos_remove_request (&imx_data->pm_qos_req); - -sdhci_pltfm_free (pdev); }#ifdef
CONFIG_PM_SLEEP
--
2.47.1
PATCH v3 13/35 mmc: sdhci-esdhc-mcf: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-esdhc-mcf.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-)
drivers/mmc/host/sdhci-esdhc-mcf.c +7 -18
@@ -426,28 +426,22 @@ static int sdhci_esdhc_mcf_probe(struct platform_device *pdev) host->flags |=SDHCI_AUTO_CMD12 ; mcf_data->clk_ipg =devm_clk_get (&pdev->dev,"ipg" ); -if (IS_ERR (mcf_data->clk_ipg)) { - err =PTR_ERR (mcf_data->clk_ipg); - goto err_exit; - } +if (IS_ERR (mcf_data->clk_ipg)) +return PTR_ERR (mcf_data->clk_ipg); mcf_data->clk_ahb =devm_clk_get (&pdev->dev,"ahb" ); -if (IS_ERR (mcf_data->clk_ahb)) { - err =PTR_ERR (mcf_data->clk_ahb); - goto err_exit; - } +if (IS_ERR (mcf_data->clk_ahb)) +return PTR_ERR (mcf_data->clk_ahb); mcf_data->clk_per =devm_clk_get (&pdev->dev,"per" ); -if (IS_ERR (mcf_data->clk_per)) { - err =PTR_ERR (mcf_data->clk_per); - goto err_exit; - } +if (IS_ERR (mcf_data->clk_per)) +return PTR_ERR (mcf_data->clk_per); pltfm_host->clk = mcf_data->clk_per; pltfm_host->clock =clk_get_rate (pltfm_host->clk); err =clk_prepare_enable (mcf_data->clk_per);if (err) - goto err_exit; +return err; err =clk_prepare_enable (mcf_data->clk_ipg);if (err)
@@ -485,9 +479,6 @@ static int sdhci_esdhc_mcf_probe(struct platform_device *pdev)clk_disable_unprepare (mcf_data->clk_ipg); unprep_per:clk_disable_unprepare (mcf_data->clk_per); -err_exit: -sdhci_pltfm_free (pdev); -return err; }
@@ -502,8 +493,6 @@ static void sdhci_esdhc_mcf_remove(struct platform_device *pdev)clk_disable_unprepare (mcf_data->clk_ipg);clk_disable_unprepare (mcf_data->clk_ahb);clk_disable_unprepare (mcf_data->clk_per); - -sdhci_pltfm_free (pdev); }static struct platform_driver sdhci_esdhc_mcf_driver = {
Signature · 1 line
2.47.1
PATCH v3 14/35 mmc: sdhci-iproc: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-iproc.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci-iproc.c +4 -14
@@ -379,7 +379,7 @@ static int sdhci_iproc_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto err; +return ret;sdhci_get_property (pdev);
@@ -387,10 +387,8 @@ static int sdhci_iproc_probe(struct platform_device *pdev)if (dev->of_node) { pltfm_host->clk =devm_clk_get_enabled (dev,NULL ); -if (IS_ERR (pltfm_host->clk)) { - ret =PTR_ERR (pltfm_host->clk); - goto err; - } +if (IS_ERR (pltfm_host->clk)) +return PTR_ERR (pltfm_host->clk); }if (iproc_host->data->missing_caps) {
@@ -399,15 +397,7 @@ static int sdhci_iproc_probe(struct platform_device *pdev) &iproc_host->data->caps1); } - ret =sdhci_add_host (host); -if (ret) - goto err; - -return 0 ; - -err: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }static void sdhci_iproc_shutdown (struct platform_device *pdev)
Signature · 1 line
2.47.1
PATCH v3 15/35 mmc: sdhci-msm: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-msm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/mmc/host/sdhci-msm.c +4 -7
@@ -2530,7 +2530,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto pltfm_free; +return ret;/* * Based on the compatible string, load the required msm host info from
@@ -2552,7 +2552,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) ret =sdhci_msm_gcc_reset (&pdev->dev, host);if (ret) - goto pltfm_free; +return ret;/* Setup SDCC bus voter clock. */ msm_host->bus_clk =devm_clk_get (&pdev->dev,"bus" );
@@ -2560,10 +2560,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)/* Vote for max. clk rate for max. performance */ ret =clk_set_rate (msm_host->bus_clk,INT_MAX );if (ret) - goto pltfm_free; +return ret; ret =clk_prepare_enable (msm_host->bus_clk);if (ret) - goto pltfm_free; +return ret; }/* Setup main peripheral bus clock */
@@ -2769,8 +2769,6 @@ static int sdhci_msm_probe(struct platform_device *pdev) bus_clk_disable:if (!IS_ERR (msm_host->bus_clk))clk_disable_unprepare (msm_host->bus_clk); -pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
@@ -2792,7 +2790,6 @@ static void sdhci_msm_remove(struct platform_device *pdev) msm_host->bulk_clks);if (!IS_ERR (msm_host->bus_clk))clk_disable_unprepare (msm_host->bus_clk); -sdhci_pltfm_free (pdev); }static __maybe_unused int sdhci_msm_runtime_suspend (struct device *dev)
Signature · 1 line
2.47.1
PATCH v3 16/35 mmc: sdhci-npcm: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-npcm.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/mmc/host/sdhci-npcm.c +3 -12
@@ -48,8 +48,7 @@ static int npcm_sdhci_probe(struct platform_device *pdev) pltfm_host->clk =devm_clk_get_optional_enabled (dev,NULL );if (IS_ERR (pltfm_host->clk)) { - ret =PTR_ERR (pltfm_host->clk); - goto err_sdhci; +return PTR_ERR (pltfm_host->clk); } caps =sdhci_readl (host,SDHCI_CAPABILITIES );
@@ -58,17 +57,9 @@ static int npcm_sdhci_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto err_sdhci; +return ret; - ret =sdhci_add_host (host); -if (ret) - goto err_sdhci; - -return 0 ; - -err_sdhci: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }static const struct of_device_id npcm_sdhci_of_match[] = {
Signature · 1 line
2.47.1
PATCH v3 17/35 mmc: sdhci-of-arasan: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-arasan.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +8 -18
@@ -1883,34 +1883,26 @@ static int sdhci_arasan_probe(struct platform_device *pdev) sdhci_arasan->soc_ctl_base =syscon_node_to_regmap (node);of_node_put (node); -if (IS_ERR (sdhci_arasan->soc_ctl_base)) { - ret =dev_err_probe (dev, +if (IS_ERR (sdhci_arasan->soc_ctl_base)) +return dev_err_probe (dev,PTR_ERR (sdhci_arasan->soc_ctl_base),"Can't get syscon\n" ); - goto err_pltfm_free; - } }sdhci_get_of_property (pdev); sdhci_arasan->clk_ahb =devm_clk_get (dev,"clk_ahb" ); -if (IS_ERR (sdhci_arasan->clk_ahb)) { - ret =dev_err_probe (dev,PTR_ERR (sdhci_arasan->clk_ahb), +if (IS_ERR (sdhci_arasan->clk_ahb)) +return dev_err_probe (dev,PTR_ERR (sdhci_arasan->clk_ahb),"clk_ahb clock not found.\n" ); - goto err_pltfm_free; - } clk_xin =devm_clk_get (dev,"clk_xin" ); -if (IS_ERR (clk_xin)) { - ret =dev_err_probe (dev,PTR_ERR (clk_xin),"clk_xin clock not found.\n" ); - goto err_pltfm_free; - } +if (IS_ERR (clk_xin)) +return dev_err_probe (dev,PTR_ERR (clk_xin),"clk_xin clock not found.\n" ); ret =clk_prepare_enable (sdhci_arasan->clk_ahb); -if (ret) { -dev_err (dev,"Unable to enable AHB clock.\n" ); - goto err_pltfm_free; - } +if (ret) +return dev_err_probe (dev, ret,"Unable to enable AHB clock.\n" );/* If clock-frequency property is set, use the provided value */ if (pltfm_host->clock &&
@@ -2029,8 +2021,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev)clk_disable_unprepare (clk_xin); clk_dis_ahb:clk_disable_unprepare (sdhci_arasan->clk_ahb); -err_pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
Signature · 1 line
2.47.1
PATCH v3 18/35 mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-aspeed.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/mmc/host/sdhci-of-aspeed.c +2 -8
@@ -425,10 +425,8 @@ static int aspeed_sdhci_probe(struct platform_device *pdev)return PTR_ERR (pltfm_host->clk); ret =clk_prepare_enable (pltfm_host->clk); -if (ret) { -dev_err (&pdev->dev,"Unable to enable SDIO clock\n" ); - goto err_pltfm_free; - } +if (ret) +return dev_err_probe (&pdev->dev, ret,"Unable to enable SDIO clock\n" ); ret =mmc_of_parse (host->mmc);if (ret)
@@ -445,8 +443,6 @@ static int aspeed_sdhci_probe(struct platform_device *pdev) err_sdhci_add:clk_disable_unprepare (pltfm_host->clk); -err_pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
@@ -461,8 +457,6 @@ static void aspeed_sdhci_remove(struct platform_device *pdev)sdhci_remove_host (host,0 );clk_disable_unprepare (pltfm_host->clk); - -sdhci_pltfm_free (pdev); }static const struct aspeed_sdhci_pdata ast2400_sdhci_pdata = {
Signature · 1 line
2.47.1
PATCH v3 19/35 mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-at91.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-)
drivers/mmc/host/sdhci-of-at91.c +11 -19
@@ -333,32 +333,26 @@ static int sdhci_at91_probe(struct platform_device *pdev) priv->mainck =devm_clk_get (&pdev->dev,"baseclk" );if (IS_ERR (priv->mainck)) { -if (soc_data->baseclk_is_generated_internally) { +if (soc_data->baseclk_is_generated_internally) priv->mainck =NULL ; - }else { -dev_err (&pdev->dev,"failed to get baseclk\n" ); - ret =PTR_ERR (priv->mainck); - goto sdhci_pltfm_free; - } +else +return dev_err_probe (&pdev->dev,PTR_ERR (priv->mainck), +"failed to get baseclk\n" ); } priv->hclock =devm_clk_get (&pdev->dev,"hclock" ); -if (IS_ERR (priv->hclock)) { -dev_err (&pdev->dev,"failed to get hclock\n" ); - ret =PTR_ERR (priv->hclock); - goto sdhci_pltfm_free; - } +if (IS_ERR (priv->hclock)) +return dev_err_probe (&pdev->dev,PTR_ERR (priv->hclock), +"failed to get hclock\n" ); priv->gck =devm_clk_get (&pdev->dev,"multclk" ); -if (IS_ERR (priv->gck)) { -dev_err (&pdev->dev,"failed to get multclk\n" ); - ret =PTR_ERR (priv->gck); - goto sdhci_pltfm_free; - } +if (IS_ERR (priv->gck)) +return dev_err_probe (&pdev->dev,PTR_ERR (priv->gck), +"failed to get multclk\n" ); ret =sdhci_at91_set_clks_presets (&pdev->dev);if (ret) - goto sdhci_pltfm_free; +return ret; priv->restore_needed = false;
@@ -438,8 +432,6 @@ static int sdhci_at91_probe(struct platform_device *pdev)clk_disable_unprepare (priv->gck);clk_disable_unprepare (priv->mainck);clk_disable_unprepare (priv->hclock); -sdhci_pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
Signature · 1 line
2.47.1
Re: [PATCH v3 19/35] mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()
Quoted 9 lines · Binbin Zhou
Since the
devm_mmc_alloc_host()helper is already in use,sdhci_pltfm_free()is no longer needed.Cc Aubin Constans <[email protected]>Cc Eugen Hristev <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Alexandre Belloni <[email protected]>Cc Claudiu Beznea <[email protected]>Signed-off-by Binbin Zhou <[email protected]>
Quoted 64 lines
--- drivers/mmc/host/sdhci-of-at91.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-)drivers/mmc/host/sdhci-of-at91.c +11
-20@@ -333,32 +333,26 @@ static int sdhci_at91_probe(struct platform_device *pdev) priv->mainck =devm_clk_get (&pdev->dev,"baseclk" );if (IS_ERR (priv->mainck)) { -if (soc_data->baseclk_is_generated_internally) { +if (soc_data->baseclk_is_generated_internally) priv->mainck =NULL ; - }else { -dev_err (&pdev->dev,"failed to get baseclk\n" ); - ret =PTR_ERR (priv->mainck); - goto sdhci_pltfm_free; - } +else +return dev_err_probe (&pdev->dev,PTR_ERR (priv->mainck), +"failed to get baseclk\n" ); } priv->hclock =devm_clk_get (&pdev->dev,"hclock" ); -if (IS_ERR (priv->hclock)) { -dev_err (&pdev->dev,"failed to get hclock\n" ); - ret =PTR_ERR (priv->hclock); - goto sdhci_pltfm_free; - } +if (IS_ERR (priv->hclock)) +return dev_err_probe (&pdev->dev,PTR_ERR (priv->hclock), +"failed to get hclock\n" ); priv->gck =devm_clk_get (&pdev->dev,"multclk" ); -if (IS_ERR (priv->gck)) { -dev_err (&pdev->dev,"failed to get multclk\n" ); - ret =PTR_ERR (priv->gck); - goto sdhci_pltfm_free; - } +if (IS_ERR (priv->gck)) +return dev_err_probe (&pdev->dev,PTR_ERR (priv->gck), +"failed to get multclk\n" ); ret =sdhci_at91_set_clks_presets (&pdev->dev);if (ret) - goto sdhci_pltfm_free; +return ret; priv->restore_needed = false;@@ -438,8 +432,6 @@ static int sdhci_at91_probe(struct platform_device *pdev)clk_disable_unprepare (priv->gck);clk_disable_unprepare (priv->mainck);clk_disable_unprepare (priv->hclock); -sdhci_pltfm_free: -sdhci_pltfm_free (pdev);return ret; } --2.47.1
PATCH v3 20/35 mmc: sdhci-of-dwcmshc: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-dwcmshc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/mmc/host/sdhci-of-dwcmshc.c +5 -9
@@ -1387,14 +1387,13 @@ static int dwcmshc_probe(struct platform_device *pdev)if (dev->of_node) { pltfm_host->clk =devm_clk_get (dev,"core" ); -if (IS_ERR (pltfm_host->clk)) { - err =PTR_ERR (pltfm_host->clk); -dev_err (dev,"failed to get core clk: %d\n" , err); - goto free_pltfm; - } +if (IS_ERR (pltfm_host->clk)) +return dev_err_probe (dev,PTR_ERR (pltfm_host->clk), +"failed to get core clk\n" ); + err =clk_prepare_enable (pltfm_host->clk);if (err) - goto free_pltfm; +return err; priv->bus_clk =devm_clk_get (dev,"bus" );if (!IS_ERR (priv->bus_clk))
@@ -1467,8 +1466,6 @@ static int dwcmshc_probe(struct platform_device *pdev)clk_disable_unprepare (pltfm_host->clk);clk_disable_unprepare (priv->bus_clk);clk_bulk_disable_unprepare (priv->num_other_clks, priv->other_clks); -free_pltfm: -sdhci_pltfm_free (pdev);return err; }
@@ -1500,7 +1497,6 @@ static void dwcmshc_remove(struct platform_device *pdev)clk_disable_unprepare (pltfm_host->clk);clk_disable_unprepare (priv->bus_clk);clk_bulk_disable_unprepare (priv->num_other_clks, priv->other_clks); -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 21/35 mmc: sdhci-of-esdhc: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-esdhc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +2 -9
@@ -1499,18 +1499,11 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)/* call to generic mmc_of_parse to support additional capabilities */ ret =mmc_of_parse (host->mmc);if (ret) - goto err; +return ret;mmc_of_parse_voltage (host->mmc, &host->ocr_mask); - ret =sdhci_add_host (host); -if (ret) - goto err; - -return 0 ; - err: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }static struct platform_driver sdhci_esdhc_driver = {
Signature · 1 line
2.47.1
PATCH v3 22/35 mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-k1.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/sdhci-of-k1.c +0 -1
@@ -286,7 +286,6 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)return 0 ; err_pltfm: -sdhci_pltfm_free (pdev);return ret; }
Signature · 1 line
2.47.1
PATCH v3 23/35 mmc: sdhci-of-ma35d1: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-ma35d1.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-)
drivers/mmc/host/sdhci-of-ma35d1.c +8 -15
@@ -211,20 +211,18 @@ static int ma35_probe(struct platform_device *pdev) priv =sdhci_pltfm_priv (pltfm_host); pltfm_host->clk =devm_clk_get_optional_enabled (dev,NULL ); -if (IS_ERR (pltfm_host->clk)) { - err =dev_err_probe (dev,PTR_ERR (pltfm_host->clk),"failed to get clk\n" ); - goto err_sdhci; - } +if (IS_ERR (pltfm_host->clk)) +return dev_err_probe (dev,PTR_ERR (pltfm_host->clk), +"failed to get clk\n" ); err =mmc_of_parse (host->mmc);if (err) - goto err_sdhci; +return err; priv->rst =devm_reset_control_get_exclusive (dev,NULL ); -if (IS_ERR (priv->rst)) { - err =dev_err_probe (dev,PTR_ERR (priv->rst),"failed to get reset control\n" ); - goto err_sdhci; - } +if (IS_ERR (priv->rst)) +return dev_err_probe (dev,PTR_ERR (priv->rst), +"failed to get reset control\n" );sdhci_get_of_property (pdev);
@@ -255,7 +253,7 @@ static int ma35_probe(struct platform_device *pdev) err =sdhci_add_host (host);if (err) - goto err_sdhci; +return err;/* * Split data into chunks of 16 or 8 bytes for transmission.
@@ -268,10 +266,6 @@ static int ma35_probe(struct platform_device *pdev)sdhci_writew (host, ctl,MA35_SDHCI_MBIUCTL );return 0 ; - -err_sdhci: -sdhci_pltfm_free (pdev); -return err; }static void ma35_disable_card_clk (struct sdhci_host *host)
@@ -291,7 +285,6 @@ static void ma35_remove(struct platform_device *pdev)sdhci_remove_host (host,0 );ma35_disable_card_clk (host); -sdhci_pltfm_free (pdev); }static const struct of_device_id sdhci_ma35_dt_ids[] = {
Signature · 1 line
2.47.1
PATCH v3 24/35 mmc: sdhci-of-sparx5: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-of-sparx5.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)
drivers/mmc/host/sdhci-of-sparx5.c +8 -16
@@ -185,11 +185,9 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) sdhci_sparx5->host = host; pltfm_host->clk =devm_clk_get_enabled (&pdev->dev,"core" ); -if (IS_ERR (pltfm_host->clk)) { - ret =PTR_ERR (pltfm_host->clk); -dev_err (&pdev->dev,"failed to get and enable core clk: %d\n" , ret); - goto free_pltfm; - } +if (IS_ERR (pltfm_host->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (pltfm_host->clk), +"failed to get and enable core clk\n" );if (!of_property_read_u32 (np,"microchip,clock-delay" , &value) && (value >0 && value <=MSHC_DLY_CC_MAX ))
@@ -199,14 +197,12 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto free_pltfm; +return ret; sdhci_sparx5->cpu_ctrl =syscon_regmap_lookup_by_compatible (syscon); -if (IS_ERR (sdhci_sparx5->cpu_ctrl)) { -dev_err (&pdev->dev,"No CPU syscon regmap !\n" ); - ret =PTR_ERR (sdhci_sparx5->cpu_ctrl); - goto free_pltfm; - } +if (IS_ERR (sdhci_sparx5->cpu_ctrl)) +return dev_err_probe (&pdev->dev,PTR_ERR (sdhci_sparx5->cpu_ctrl), +"No CPU syscon regmap !\n" );if (sdhci_sparx5->delay_clock >=0 )sparx5_set_delay (host, sdhci_sparx5->delay_clock);
@@ -222,7 +218,7 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) - goto free_pltfm; +return ret;/* Set AXI bus master to use un-cached access (for DMA) */ if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA) &&
@@ -235,10 +231,6 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) mmc_hostname(host->mmc), sdhci_readl(host, MSHC2_TYPE));return ret; - -free_pltfm: -sdhci_pltfm_free (pdev); -return ret; }static const struct of_device_id sdhci_sparx5_of_match[] = {
Signature · 1 line
2.47.1
Re: [PATCH v3 24/35] mmc: sdhci-of-sparx5: Drop the use of sdhci_pltfm_free()
Quoted 2 lines
Since the
devm_mmc_alloc_host()helper is already in use,sdhci_pltfm_free()is no longer needed.
Quoted 69 lines
Cc Steen Hegelund <[email protected]>Cc Daniel Machon <[email protected]>Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci-of-sparx5.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-)drivers/mmc/host/sdhci-of-sparx5.c +8
-17@@ -185,11 +185,9 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) sdhci_sparx5->host = host; pltfm_host->clk =devm_clk_get_enabled (&pdev->dev,"core" ); -if (IS_ERR (pltfm_host->clk)) { - ret =PTR_ERR (pltfm_host->clk); -dev_err (&pdev->dev,"failed to get and enable core clk: %d\n" , ret); - goto free_pltfm; - } +if (IS_ERR (pltfm_host->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (pltfm_host->clk), +"failed to get and enable core clk\n" );if (!of_property_read_u32 (np,"microchip,clock-delay" , &value) && (value >0 && value <=MSHC_DLY_CC_MAX ))@@ -199,14 +197,12 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto free_pltfm; +return ret; sdhci_sparx5->cpu_ctrl =syscon_regmap_lookup_by_compatible (syscon); -if (IS_ERR (sdhci_sparx5->cpu_ctrl)) { -dev_err (&pdev->dev,"No CPU syscon regmap !\n" ); - ret =PTR_ERR (sdhci_sparx5->cpu_ctrl); - goto free_pltfm; - } +if (IS_ERR (sdhci_sparx5->cpu_ctrl)) +return dev_err_probe (&pdev->dev,PTR_ERR (sdhci_sparx5->cpu_ctrl), +"No CPU syscon regmap !\n" );if (sdhci_sparx5->delay_clock >=0 )sparx5_set_delay (host, sdhci_sparx5->delay_clock);@@ -222,7 +218,7 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) - goto free_pltfm; +return ret;/* Set AXI bus master to use un-cached access (for DMA) */ if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA) &&@@ -235,10 +231,6 @@ static int sdhci_sparx5_probe(struct platform_device *pdev) mmc_hostname(host->mmc), sdhci_readl(host, MSHC2_TYPE));return ret; - -free_pltfm: -sdhci_pltfm_free (pdev); -return ret; }static const struct of_device_id sdhci_sparx5_of_match[] = { --2.47.1
PATCH v3 25/35 mmc: sdhci-omap: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-omap.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci-omap.c +7 -14
@@ -1257,7 +1257,7 @@ static int sdhci_omap_probe(struct platform_device *pdev)sdhci_get_of_property (pdev); ret =mmc_of_parse (mmc);if (ret) - goto err_pltfm_free; +return ret; soc =soc_device_match (sdhci_omap_soc_devices);if (soc) {
@@ -1274,22 +1274,19 @@ static int sdhci_omap_probe(struct platform_device *pdev) mmc->caps2 |=MMC_CAP2_NO_WRITE_PROTECT ; pltfm_host->clk =devm_clk_get (dev,"fck" ); -if (IS_ERR (pltfm_host->clk)) { - ret =PTR_ERR (pltfm_host->clk); - goto err_pltfm_free; - } +if (IS_ERR (pltfm_host->clk)) +return PTR_ERR (pltfm_host->clk); ret =clk_set_rate (pltfm_host->clk, mmc->f_max); -if (ret) { -dev_err (dev,"failed to set clock to %d\n" , mmc->f_max); - goto err_pltfm_free; - } +if (ret) +return dev_err_probe (dev, ret, +"failed to set clock to %d\n" , mmc->f_max); omap_host->pbias =devm_regulator_get_optional (dev,"pbias" );if (IS_ERR (omap_host->pbias)) { ret =PTR_ERR (omap_host->pbias);if (ret != -ENODEV ) - goto err_pltfm_free; +return ret;dev_dbg (dev,"unable to get pbias regulator %d\n" , ret); } omap_host->pbias_enabled = false;
@@ -1387,9 +1384,6 @@ static int sdhci_omap_probe(struct platform_device *pdev) err_rpm_disable:pm_runtime_dont_use_autosuspend (dev);pm_runtime_disable (dev); - -err_pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
@@ -1406,7 +1400,6 @@ static void sdhci_omap_remove(struct platform_device *pdev)pm_runtime_put_sync (dev);/* Ensure device gets disabled despite userspace sysfs config */ pm_runtime_force_suspend (dev); -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM
Signature · 1 line
2.47.1
PATCH v3 26/35 mmc: sdhci-pic32: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-pic32.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pic32.c +3 -6
@@ -157,20 +157,20 @@ static int pic32_sdhci_probe(struct platform_device *pdev) ret = plat_data->setup_dma (ADMA_FIFO_RD_THSHLD ,ADMA_FIFO_WR_THSHLD );if (ret) - goto err_host; + goto err; } sdhci_pdata->sys_clk =devm_clk_get (&pdev->dev,"sys_clk" );if (IS_ERR (sdhci_pdata->sys_clk)) { ret =PTR_ERR (sdhci_pdata->sys_clk);dev_err (&pdev->dev,"Error getting clock\n" ); - goto err_host; + goto err; } ret =clk_prepare_enable (sdhci_pdata->sys_clk);if (ret) {dev_err (&pdev->dev,"Error enabling clock\n" ); - goto err_host; + goto err; } sdhci_pdata->base_clk =devm_clk_get (&pdev->dev,"base_clk" );
@@ -203,8 +203,6 @@ static int pic32_sdhci_probe(struct platform_device *pdev)clk_disable_unprepare (sdhci_pdata->base_clk); err_sys_clk:clk_disable_unprepare (sdhci_pdata->sys_clk); -err_host: -sdhci_pltfm_free (pdev); err:dev_err (&pdev->dev,"pic32-sdhci probe failed: %d\n" , ret);return ret;
@@ -220,7 +218,6 @@ static void pic32_sdhci_remove(struct platform_device *pdev)sdhci_remove_host (host, scratch == (u32 )~0 );clk_disable_unprepare (sdhci_pdata->base_clk);clk_disable_unprepare (sdhci_pdata->sys_clk); -sdhci_pltfm_free (pdev); }static const struct of_device_id pic32_sdhci_id_table[] = {
Signature · 1 line
2.47.1
PATCH v3 27/35 mmc: sdhci-pxav2: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-pxav2.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-)
drivers/mmc/host/sdhci-pxav2.c +6 -20
@@ -258,7 +258,6 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)struct sdhci_host *host =NULL ;const struct sdhci_pxa_variant *variant; -int ret;struct clk *clk, *clk_core; host =sdhci_pltfm_init (pdev,NULL ,sizeof (*pxav2_host));
@@ -271,19 +270,14 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) clk =devm_clk_get_optional_enabled (dev,"io" );if (!clk) clk =devm_clk_get_enabled (dev,NULL ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); -dev_err_probe (dev, ret,"failed to get io clock\n" ); - goto free; - } +if (IS_ERR (clk)) +return dev_err_probe (dev,PTR_ERR (clk),"failed to get io clock\n" ); pltfm_host->clk = clk; clk_core =devm_clk_get_optional_enabled (dev,"core" ); -if (IS_ERR (clk_core)) { - ret =PTR_ERR (clk_core); -dev_err_probe (dev, ret,"failed to enable core clock\n" ); - goto free; - } +if (IS_ERR (clk_core)) +return dev_err_probe (dev,PTR_ERR (clk_core), +"failed to enable core clock\n" ); host->quirks =SDHCI_QUIRK_BROKEN_ADMA |SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
@@ -332,15 +326,7 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) pxav2_host->pinctrl =NULL ; } - ret =sdhci_add_host (host); -if (ret) - goto free; - -return 0 ; - -free: -sdhci_pltfm_free (pdev); -return ret; +return sdhci_add_host (host); }static struct platform_driver sdhci_pxav2_driver = {
Signature · 1 line
2.47.1
PATCH v3 28/35 mmc: sdhci-pxav3: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-pxav3.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +1 -6
@@ -389,8 +389,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) pxa->clk_io =devm_clk_get (dev,NULL );if (IS_ERR (pxa->clk_io)) {dev_err (dev,"failed to get io clock\n" ); - ret =PTR_ERR (pxa->clk_io); - goto err_clk_get; +return PTR_ERR (pxa->clk_io); } pltfm_host->clk = pxa->clk_io;clk_prepare_enable (pxa->clk_io);
@@ -466,8 +465,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) err_mbus_win:clk_disable_unprepare (pxa->clk_io);clk_disable_unprepare (pxa->clk_core); -err_clk_get: -sdhci_pltfm_free (pdev);return ret; }
@@ -485,8 +482,6 @@ static void sdhci_pxav3_remove(struct platform_device *pdev)clk_disable_unprepare (pxa->clk_io);clk_disable_unprepare (pxa->clk_core); - -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 29/35 mmc: sdhci-sprd: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-sprd.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-)
drivers/mmc/host/sdhci-sprd.c +10 -23
@@ -764,7 +764,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto pltfm_free; +return ret;if (!mmc_card_is_removable (host->mmc)) host->mmc_host_ops.request_atomic = sdhci_sprd_request_atomic;
@@ -778,34 +778,26 @@ static int sdhci_sprd_probe(struct platform_device *pdev)if (!IS_ERR (sprd_host->pinctrl)) { sprd_host->pins_uhs =pinctrl_lookup_state (sprd_host->pinctrl,"state_uhs" ); -if (IS_ERR (sprd_host->pins_uhs)) { - ret =PTR_ERR (sprd_host->pins_uhs); - goto pltfm_free; - } +if (IS_ERR (sprd_host->pins_uhs)) +return PTR_ERR (sprd_host->pins_uhs); sprd_host->pins_default =pinctrl_lookup_state (sprd_host->pinctrl,"default" ); -if (IS_ERR (sprd_host->pins_default)) { - ret =PTR_ERR (sprd_host->pins_default); - goto pltfm_free; - } +if (IS_ERR (sprd_host->pins_default)) +return PTR_ERR (sprd_host->pins_default); } clk =devm_clk_get (&pdev->dev,"sdio" ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); - goto pltfm_free; - } +if (IS_ERR (clk)) +return PTR_ERR (clk); sprd_host->clk_sdio = clk; sprd_host->base_rate =clk_get_rate (sprd_host->clk_sdio);if (!sprd_host->base_rate) sprd_host->base_rate =SDHCI_SPRD_CLK_DEF_RATE ; clk =devm_clk_get (&pdev->dev,"enable" ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); - goto pltfm_free; - } +if (IS_ERR (clk)) +return PTR_ERR (clk); sprd_host->clk_enable = clk; clk =devm_clk_get (&pdev->dev,"2x_enable" );
@@ -814,7 +806,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev) ret =clk_prepare_enable (sprd_host->clk_sdio);if (ret) - goto pltfm_free; +return ret; ret =clk_prepare_enable (sprd_host->clk_enable);if (ret)
@@ -891,9 +883,6 @@ static int sdhci_sprd_probe(struct platform_device *pdev) clk_disable:clk_disable_unprepare (sprd_host->clk_sdio); - -pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
@@ -907,8 +896,6 @@ static void sdhci_sprd_remove(struct platform_device *pdev)clk_disable_unprepare (sprd_host->clk_sdio);clk_disable_unprepare (sprd_host->clk_enable);clk_disable_unprepare (sprd_host->clk_2x_enable); - -sdhci_pltfm_free (pdev); }static const struct of_device_id sdhci_sprd_of_match[] = {
Signature · 1 line
2.47.1
PATCH v3 30/35 mmc: sdhci-st: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-st.c +2 -4
@@ -380,13 +380,13 @@ static int sdhci_st_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) {dev_err (&pdev->dev,"Failed mmc_of_parse\n" ); - goto err_of; + goto err_pltfm_init; } ret =clk_prepare_enable (clk);if (ret) {dev_err (&pdev->dev,"Failed to prepare clock\n" ); - goto err_of; + goto err_pltfm_init; } ret =clk_prepare_enable (icnclk);
@@ -423,8 +423,6 @@ static int sdhci_st_probe(struct platform_device *pdev)clk_disable_unprepare (icnclk); err_icnclk:clk_disable_unprepare (clk); -err_of: -sdhci_pltfm_free (pdev); err_pltfm_init:reset_control_assert (rstc);
Signature · 1 line
2.47.1
PATCH v3 31/35 mmc: sdhci-tegra: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-tegra.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-tegra.c +3 -6
@@ -1693,7 +1693,7 @@ static int sdhci_tegra_probe(struct platform_device *pdev) rc =mmc_of_parse (host->mmc);if (rc) - goto err_parse_dt; +return rc;if (tegra_host->soc_data->nvquirks &NVQUIRK_ENABLE_DDR50 ) host->mmc->caps |=MMC_CAP_1_8V_DDR ;
@@ -1739,7 +1739,7 @@ static int sdhci_tegra_probe(struct platform_device *pdev)if (IS_ERR (clk)) { rc =PTR_ERR (clk);if (rc == -EPROBE_DEFER ) - goto err_power_req; +return rc;dev_warn (&pdev->dev,"failed to get tmclk: %d\n" , rc); clk =NULL ;
@@ -1750,7 +1750,7 @@ static int sdhci_tegra_probe(struct platform_device *pdev)if (rc) {dev_err (&pdev->dev,"failed to enable tmclk: %d\n" , rc); - goto err_power_req; +return rc; } tegra_host->tmclk = clk;
@@ -1811,8 +1811,6 @@ static int sdhci_tegra_probe(struct platform_device *pdev) err_clk_get:clk_disable_unprepare (tegra_host->tmclk); err_power_req: -err_parse_dt: -sdhci_pltfm_free (pdev);return rc; }
@@ -1831,7 +1829,6 @@ static void sdhci_tegra_remove(struct platform_device *pdev)pm_runtime_force_suspend (&pdev->dev);clk_disable_unprepare (tegra_host->tmclk); -sdhci_pltfm_free (pdev); }static int __maybe_unused sdhci_tegra_runtime_suspend (struct device *dev)
Signature · 1 line
2.47.1
Re: [PATCH v3 31/35] mmc: sdhci-tegra: Drop the use of sdhci_pltfm_free()
Quoted 10 lines · Binbin Zhou
Since the
devm_mmc_alloc_host()helper is already in use,sdhci_pltfm_free()is no longer needed.Cc Thierry Reding <[email protected]>Cc Jonathan Hunter <[email protected]>Signed-off-by Binbin Zhou <[email protected]>--- drivers/mmc/host/sdhci-tegra.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
PATCH v3 32/35 mmc: sdhci-xenon: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci-xenon.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-xenon.c +5 -10
@@ -532,14 +532,13 @@ static int xenon_probe(struct platform_device *pdev)if (dev->of_node) { pltfm_host->clk =devm_clk_get (&pdev->dev,"core" ); -if (IS_ERR (pltfm_host->clk)) { - err =PTR_ERR (pltfm_host->clk); -dev_err (&pdev->dev,"Failed to setup input clk: %d\n" , err); - goto free_pltfm; - } +if (IS_ERR (pltfm_host->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (pltfm_host->clk), +"Failed to setup input clk.\n" ); + err =clk_prepare_enable (pltfm_host->clk);if (err) - goto free_pltfm; +return err; priv->axi_clk =devm_clk_get (&pdev->dev,"axi" );if (IS_ERR (priv->axi_clk)) {
@@ -603,8 +602,6 @@ static int xenon_probe(struct platform_device *pdev)clk_disable_unprepare (priv->axi_clk); err_clk:clk_disable_unprepare (pltfm_host->clk); -free_pltfm: -sdhci_pltfm_free (pdev);return err; }
@@ -623,8 +620,6 @@ static void xenon_remove(struct platform_device *pdev)xenon_sdhc_unprepare (host);clk_disable_unprepare (priv->axi_clk);clk_disable_unprepare (pltfm_host->clk); - -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.47.1
PATCH v3 33/35 mmc: sdhci_am654: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci_am654.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci_am654.c +6 -14
@@ -942,35 +942,30 @@ static int sdhci_am654_probe(struct platform_device *pdev) clk_xin =devm_clk_get (dev,"clk_xin" );if (IS_ERR (clk_xin)) {dev_err (dev,"clk_xin clock not found.\n" ); - ret =PTR_ERR (clk_xin); - goto err_pltfm_free; +return PTR_ERR (clk_xin); } pltfm_host->clk = clk_xin; base =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (base)) { - ret =PTR_ERR (base); - goto err_pltfm_free; +return PTR_ERR (base); } sdhci_am654->base =devm_regmap_init_mmio (dev, base, &sdhci_am654_regmap_config);if (IS_ERR (sdhci_am654->base)) {dev_err (dev,"Failed to initialize regmap\n" ); - ret =PTR_ERR (sdhci_am654->base); - goto err_pltfm_free; +return PTR_ERR (sdhci_am654->base); } ret =sdhci_am654_get_of_property (pdev, sdhci_am654);if (ret) - goto err_pltfm_free; +return ret; ret =mmc_of_parse (host->mmc); -if (ret) { -dev_err_probe (dev, ret,"parsing dt failed\n" ); - goto err_pltfm_free; - } +if (ret) +return dev_err_probe (dev, ret,"parsing dt failed\n" ); host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch; host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning;
@@ -1001,8 +996,6 @@ static int sdhci_am654_probe(struct platform_device *pdev)pm_runtime_disable (dev); pm_put:pm_runtime_put_noidle (dev); -err_pltfm_free: -sdhci_pltfm_free (pdev);return ret; }
@@ -1021,7 +1014,6 @@ static void sdhci_am654_remove(struct platform_device *pdev)clk_disable_unprepare (pltfm_host->clk);pm_runtime_disable (dev);pm_runtime_put_noidle (dev); -sdhci_pltfm_free (pdev); }#ifdef CONFIG_PM
Signature · 1 line
2.47.1
PATCH v3 34/35 mmc: sdhci_f_sdh30: Drop the use of sdhci_pltfm_free()
In reply to Binbin ZhouSince the devm_mmc_alloc_host() helper is already in use, sdhci_pltfm_free() is no longer needed.
--- drivers/mmc/host/sdhci_f_sdh30.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +4 -9
@@ -133,20 +133,18 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) ret =mmc_of_parse (host->mmc);if (ret) - goto err; +return ret;if (dev_of_node (dev)) {sdhci_get_of_property (pdev); priv->clk_iface =devm_clk_get (&pdev->dev,"iface" ); -if (IS_ERR (priv->clk_iface)) { - ret =PTR_ERR (priv->clk_iface); - goto err; - } +if (IS_ERR (priv->clk_iface)) +return PTR_ERR (priv->clk_iface); ret =clk_prepare_enable (priv->clk_iface);if (ret) - goto err; +return ret; priv->clk =devm_clk_get (&pdev->dev,"core" );if (IS_ERR (priv->clk)) {
@@ -200,9 +198,6 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)clk_disable_unprepare (priv->clk); err_clk:clk_disable_unprepare (priv->clk_iface); -err: -sdhci_pltfm_free (pdev); -return ret; }
Signature · 1 line
2.47.1
PATCH v3 35/35 mmc: sdhci: Drop sdhci_free_host()/sdhci_pltfm_free() interface
In reply to Binbin ZhouFrom now on, all calls to sdhci_free_host()/sdhci_pltfm_free() have been cleaned up, so we can just delete them.
--- drivers/mmc/host/sdhci-pltfm.c | 5 ----- drivers/mmc/host/sdhci-pltfm.h | 1 - drivers/mmc/host/sdhci.c | 6 ------ drivers/mmc/host/sdhci.h | 1 - 4 files changed, 13 deletions(-)
drivers/mmc/host/sdhci-pltfm.c +0 -5
@@ -146,11 +146,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, }EXPORT_SYMBOL_GPL (sdhci_pltfm_init); -void sdhci_pltfm_free (struct platform_device *pdev) -{ -} -EXPORT_SYMBOL_GPL (sdhci_pltfm_free); -int sdhci_pltfm_init_and_add_host (struct platform_device *pdev,const struct sdhci_pltfm_data *pdata,size_t priv_size)
drivers/mmc/host/sdhci-pltfm.h +0 -1
@@ -97,7 +97,6 @@ static inline void sdhci_get_of_property(struct platform_device *pdev)extern struct sdhci_host *sdhci_pltfm_init (struct platform_device *pdev,const struct sdhci_pltfm_data *pdata,size_t priv_size); -extern void sdhci_pltfm_free (struct platform_device *pdev); extern int sdhci_pltfm_init_and_add_host(struct platform_device *pdev, const struct sdhci_pltfm_data *pdata,
drivers/mmc/host/sdhci.c +0 -6
@@ -5000,12 +5000,6 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)EXPORT_SYMBOL_GPL (sdhci_remove_host); -void sdhci_free_host (struct sdhci_host *host) -{ -} - -EXPORT_SYMBOL_GPL (sdhci_free_host); -/*****************************************************************************\ * * * Driver init/exit *
drivers/mmc/host/sdhci.h +0 -1
@@ -811,7 +811,6 @@ static inline u8 sdhci_readb(struct sdhci_host *host, int reg)#endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */ struct sdhci_host *sdhci_alloc_host (struct device *dev,size_t priv_size); -void sdhci_free_host (struct sdhci_host *host);static inline void *sdhci_priv (struct sdhci_host *host) {
Signature · 1 line
2.47.1
Quoted 109 lines · Binbin Zhou
Hi all:
After the first part of the cleanup[1], there are sdhci related drivers that need further cleanup.
This patchset is the second part of the cleanup series, and since sdhci has
sdhci_alloc_host()as the general interface, our main job is to clean upsdhci_pltfm_free()andsdhci_free_host().[1]: https://lore.kernel.org/all/[email protected]/
Thanks.
-----
V3:
- Collect Reviewed-by and Acked-by tags.
Patch-19:
- Usedev_err_probe()to cleanup the code.
Patch-32:
- Fix build warning by lkp:https://lore.kernel.org/all/[email protected]/Link to V2:
https://lore.kernel.org/all/[email protected]/V2:
- Collect Reviewed-by and Acked-by tags.Patch-01:
- Setsdhci_free_host()to empty, rather than dropping it.
Patch-07:
- Setsdhci_pltfm_free()to empty, rather than dropping it.
Patch-22:
- As requested by Yixun, retain the goto scheme.
Patch-35:
- New patch;
- Since all calls have been cleaned up, sdhci_pltfm_free()/sdhci_free_host() are now dropped directly;Link to V1:
https://lore.kernel.org/all/[email protected]/Binbin Zhou (35):
mmc: sdhci: Usedevm_mmc_alloc_host()helper
mmc: sdhci-acpi: Drop the use ofsdhci_free_host()
mmc: sdhci-milbeaut: Drop the use ofsdhci_free_host()
mmc: sdhci-pci: Drop the use ofsdhci_free_host()
mmc: sdhci-s3c: Drop the use ofsdhci_free_host()
mmc: sdhci-spear: Drop the use ofsdhci_free_host()
mmc: sdhci-pltfm: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-bcm-kona: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-brcmstb: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-cadence: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-dove: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-esdhc-imx: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-esdhc-mcf: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-iproc: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-msm: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-npcm: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-arasan: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-aspeed: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-at91: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-dwcmshc: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-esdhc: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-k1: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-ma35d1: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-of-sparx5: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-omap: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-pic32: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-pxav2: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-pxav3: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-sprd: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-st: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-tegra: Drop the use ofsdhci_pltfm_free()
mmc: sdhci-xenon: Drop the use ofsdhci_pltfm_free()
mmc:sdhci_am654: Drop the use ofsdhci_pltfm_free()
mmc:sdhci_f_sdh30: Drop the use ofsdhci_pltfm_free()
mmc: sdhci: Drop sdhci_free_host()/sdhci_pltfm_free() interfacedrivers/mmc/host/sdhci-acpi.c | 3 --- drivers/mmc/host/sdhci-bcm-kona.c | 2 -- drivers/mmc/host/sdhci-brcmstb.c | 1 - drivers/mmc/host/sdhci-cadence.c | 21 ++++++------------ drivers/mmc/host/sdhci-dove.c | 12 ++--------- drivers/mmc/host/sdhci-esdhc-imx.c | 3 --- drivers/mmc/host/sdhci-esdhc-mcf.c | 25 ++++++---------------- drivers/mmc/host/sdhci-iproc.c | 18 ++++------------ drivers/mmc/host/sdhci-milbeaut.c | 19 ++++++----------- drivers/mmc/host/sdhci-msm.c | 11 ++++------ drivers/mmc/host/sdhci-npcm.c | 15 +++---------- drivers/mmc/host/sdhci-of-arasan.c | 26 +++++++---------------- drivers/mmc/host/sdhci-of-aspeed.c | 10 ++------- drivers/mmc/host/sdhci-of-at91.c | 30 ++++++++++---------------- drivers/mmc/host/sdhci-of-dwcmshc.c | 14 +++++------- drivers/mmc/host/sdhci-of-esdhc.c | 11 ++-------- drivers/mmc/host/sdhci-of-k1.c | 1 - drivers/mmc/host/sdhci-of-ma35d1.c | 23 +++++++------------- drivers/mmc/host/sdhci-of-sparx5.c | 24 +++++++-------------- drivers/mmc/host/sdhci-omap.c | 21 ++++++------------ drivers/mmc/host/sdhci-pci-core.c | 9 ++------ drivers/mmc/host/sdhci-pic32.c | 9 +++----- drivers/mmc/host/sdhci-pltfm.c | 16 +------------- drivers/mmc/host/sdhci-pltfm.h | 1 - drivers/mmc/host/sdhci-pxav2.c | 26 ++++++----------------- drivers/mmc/host/sdhci-pxav3.c | 7 +----- drivers/mmc/host/sdhci-s3c.c | 16 ++++---------- drivers/mmc/host/sdhci-spear.c | 11 ++++------ drivers/mmc/host/sdhci-sprd.c | 33 +++++++++--------------------
Quoted 10 lines
drivers/mmc/host/sdhci-st.c | 6 ++---- drivers/mmc/host/sdhci-tegra.c | 9 +++----- drivers/mmc/host/sdhci-xenon.c | 15 +++++-------- drivers/mmc/host/sdhci.c | 9 +------- drivers/mmc/host/sdhci.h | 1 - drivers/mmc/host/sdhci_am654.c | 20 ++++++----------- drivers/mmc/host/sdhci_f_sdh30.c | 13 ++++-------- 36 files changed, 135 insertions(+), 356 deletions(-)
The series applied for next, thanks!
Kind regards
Uffe