* [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up
@ 2023-08-11 13:03 Adrian Hunter
2023-08-11 13:03 ` [PATCH 01/16] mmc: sdhci-pltfm: Add sdhci_pltfm_remove() Adrian Hunter
` (17 more replies)
0 siblings, 18 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Hi
sdhci_pltfm_unregister() does:
clk_disable_unprepare(pltfm_host->clk)
which prevents drivers from using devm_clk_get_enabled() or similar.
Move it out, and where drivers are doing devm_clk_get*() immediately
followed by clk_prepare_enable(), combine them into devm_clk_get_*enabled().
sdhci_pltfm_register() and sdhci_pltfm_unregister() are not paired functions.
That are just helpers and effectively get renamed:
sdhci_pltfm_register() -> sdhci_pltfm_init_and_add_host()
sdhci_pltfm_unregister() -> sdhci_pltfm_remove()
Please note, the patches are based on top of some
"Convert to platform remove callback returning void"
patches by Yangtao Li, which were posted here:
https://lore.kernel.org/linux-mmc/20230727070051.17778-1-frank.li@vivo.com/
Patches can also be found here:
https://github.com/ahunter6/linux/commits/sdhci-pltfm-cleanup-1
Adrian Hunter (16):
mmc: sdhci-pltfm: Add sdhci_pltfm_remove()
mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove()
mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
mmc: sdhci-cadence: Use sdhci_pltfm_remove()
mmc: sdhci-dove: Use sdhci_pltfm_remove()
mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove()
mmc: sdhci-iproc: Use sdhci_pltfm_remove()
mmc: sdhci-of-arasan: Use sdhci_pltfm_remove()
mmc: sdhci-of-at91: Use sdhci_pltfm_remove()
mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove()
mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove()
mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove()
mmc: sdhci-pxav2: Use sdhci_pltfm_remove()
mmc: sdhci-st: Use sdhci_pltfm_remove()
mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister()
mmc: sdhci-pltfm: Rename sdhci_pltfm_register()
drivers/mmc/host/sdhci-bcm-kona.c | 12 +++++++++++-
drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
drivers/mmc/host/sdhci-cadence.c | 17 ++++-------------
drivers/mmc/host/sdhci-dove.c | 8 ++------
drivers/mmc/host/sdhci-iproc.c | 14 +++-----------
drivers/mmc/host/sdhci-of-arasan.c | 4 +++-
drivers/mmc/host/sdhci-of-at91.c | 2 +-
drivers/mmc/host/sdhci-of-esdhc.c | 2 +-
drivers/mmc/host/sdhci-of-hlwd.c | 4 ++--
drivers/mmc/host/sdhci-of-sparx5.c | 17 ++++++-----------
drivers/mmc/host/sdhci-pltfm.c | 14 ++++++--------
drivers/mmc/host/sdhci-pltfm.h | 8 ++++----
drivers/mmc/host/sdhci-pxav2.c | 19 ++++++-------------
drivers/mmc/host/sdhci-st.c | 4 +++-
drivers/mmc/host/sdhci_f_sdh30.c | 2 +-
15 files changed, 58 insertions(+), 87 deletions(-)
Regards
Adrian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 01/16] mmc: sdhci-pltfm: Add sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 02/16] mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove() Adrian Hunter
` (16 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Add sdhci_pltfm_remove() to replace sdhci_pltfm_unregister().
The difference is that sdhci_pltfm_remove() does not do:
clk_disable_unprepare(pltfm_host->clk);
which allows drivers to choose to use devm_clk_get_enabled() or
similar, for pltfm_host->clk.
Once all drivers using sdhci_pltfm_unregister() have been amended to use
sdhci_pltfm_remove() instead, sdhci_pltfm_unregister() will be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-pltfm.c | 10 ++++++++++
drivers/mmc/host/sdhci-pltfm.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 72d07b49b0a3..5a63c8818987 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -199,6 +199,16 @@ void sdhci_pltfm_unregister(struct platform_device *pdev)
}
EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
+void sdhci_pltfm_remove(struct platform_device *pdev)
+{
+ struct sdhci_host *host = platform_get_drvdata(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);
+
#ifdef CONFIG_PM_SLEEP
int sdhci_pltfm_suspend(struct device *dev)
{
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 6e6a443dafd9..402f4edc6ca5 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -103,6 +103,7 @@ extern int sdhci_pltfm_register(struct platform_device *pdev,
const struct sdhci_pltfm_data *pdata,
size_t priv_size);
extern void sdhci_pltfm_unregister(struct platform_device *pdev);
+extern void sdhci_pltfm_remove(struct platform_device *pdev);
extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 02/16] mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
2023-08-11 13:03 ` [PATCH 01/16] mmc: sdhci-pltfm: Add sdhci_pltfm_remove() Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 03/16] mmc: sdhci-brcmstb: " Adrian Hunter
` (15 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-bcm-kona.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 02bb871e838f..cb9152c6a65d 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -310,6 +310,16 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
return ret;
}
+static void sdhci_bcm_kona_remove(struct platform_device *pdev)
+{
+ struct sdhci_host *host = platform_get_drvdata(pdev);
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct clk *clk = pltfm_host->clk;
+
+ sdhci_pltfm_remove(pdev);
+ clk_disable_unprepare(clk);
+}
+
static struct platform_driver sdhci_bcm_kona_driver = {
.driver = {
.name = "sdhci-kona",
@@ -318,7 +328,7 @@ static struct platform_driver sdhci_bcm_kona_driver = {
.of_match_table = sdhci_bcm_kona_of_match,
},
.probe = sdhci_bcm_kona_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_bcm_kona_remove,
};
module_platform_driver(sdhci_bcm_kona_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 03/16] mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
2023-08-11 13:03 ` [PATCH 01/16] mmc: sdhci-pltfm: Add sdhci_pltfm_remove() Adrian Hunter
2023-08-11 13:03 ` [PATCH 02/16] mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove() Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-25 16:22 ` Kamal Dasu
2023-08-11 13:03 ` [PATCH 04/16] mmc: sdhci-cadence: " Adrian Hunter
` (14 subsequent siblings)
17 siblings, 1 reply; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_optional_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
index a2b6d8f2eeb6..c23251bb95f3 100644
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -264,23 +264,17 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "Probe found match for %s\n", match->compatible);
- clk = devm_clk_get_optional(&pdev->dev, NULL);
+ clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
if (IS_ERR(clk))
return dev_err_probe(&pdev->dev, PTR_ERR(clk),
- "Failed to get clock from Device Tree\n");
-
- res = clk_prepare_enable(clk);
- if (res)
- return res;
+ "Failed to get and enable clock from Device Tree\n");
memset(&brcmstb_pdata, 0, sizeof(brcmstb_pdata));
brcmstb_pdata.ops = match_priv->ops;
host = sdhci_pltfm_init(pdev, &brcmstb_pdata,
sizeof(struct sdhci_brcmstb_priv));
- if (IS_ERR(host)) {
- res = PTR_ERR(host);
- goto err_clk;
- }
+ if (IS_ERR(host))
+ return PTR_ERR(host);
pltfm_host = sdhci_priv(host);
priv = sdhci_pltfm_priv(pltfm_host);
@@ -369,9 +363,7 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
err:
sdhci_pltfm_free(pdev);
-err_clk:
clk_disable_unprepare(base_clk);
- clk_disable_unprepare(clk);
return res;
}
@@ -430,7 +422,7 @@ static struct platform_driver sdhci_brcmstb_driver = {
.of_match_table = of_match_ptr(sdhci_brcm_of_match),
},
.probe = sdhci_brcmstb_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
.shutdown = sdhci_brcmstb_shutdown,
};
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 04/16] mmc: sdhci-cadence: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (2 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 03/16] mmc: sdhci-brcmstb: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 05/16] mmc: sdhci-dove: " Adrian Hunter
` (13 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-cadence.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index 8cdc178ec1ba..be1505e8c536 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -487,14 +487,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
static const u16 version = SDHCI_SPEC_400 << SDHCI_SPEC_VER_SHIFT;
- clk = devm_clk_get(dev, NULL);
+ clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(clk))
return PTR_ERR(clk);
- ret = clk_prepare_enable(clk);
- if (ret)
- return ret;
-
data = of_device_get_match_data(dev);
if (!data)
data = &sdhci_cdns_drv_data;
@@ -502,10 +498,8 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node);
host = sdhci_pltfm_init(pdev, &data->pltfm_data,
struct_size(priv, phy_params, nr_phy_params));
- if (IS_ERR(host)) {
- ret = PTR_ERR(host);
- goto disable_clk;
- }
+ if (IS_ERR(host))
+ return PTR_ERR(host);
pltfm_host = sdhci_priv(host);
pltfm_host->clk = clk;
@@ -556,9 +550,6 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
return 0;
free:
sdhci_pltfm_free(pdev);
-disable_clk:
- clk_disable_unprepare(clk);
-
return ret;
}
@@ -617,7 +608,7 @@ static struct platform_driver sdhci_cdns_driver = {
.of_match_table = sdhci_cdns_match,
},
.probe = sdhci_cdns_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_cdns_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 05/16] mmc: sdhci-dove: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (3 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 04/16] mmc: sdhci-cadence: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 06/16] mmc: sdhci_f_sdh30: " Adrian Hunter
` (12 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-dove.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c
index 75335dbf223c..88ec23417808 100644
--- a/drivers/mmc/host/sdhci-dove.c
+++ b/drivers/mmc/host/sdhci-dove.c
@@ -75,10 +75,7 @@ static int sdhci_dove_probe(struct platform_device *pdev)
return PTR_ERR(host);
pltfm_host = sdhci_priv(host);
- pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
-
- if (!IS_ERR(pltfm_host->clk))
- clk_prepare_enable(pltfm_host->clk);
+ pltfm_host->clk = devm_clk_get_enabled(&pdev->dev, NULL);
ret = mmc_of_parse(host->mmc);
if (ret)
@@ -91,7 +88,6 @@ static int sdhci_dove_probe(struct platform_device *pdev)
return 0;
err_sdhci_add:
- clk_disable_unprepare(pltfm_host->clk);
sdhci_pltfm_free(pdev);
return ret;
}
@@ -110,7 +106,7 @@ static struct platform_driver sdhci_dove_driver = {
.of_match_table = sdhci_dove_of_match_table,
},
.probe = sdhci_dove_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_dove_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 06/16] mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (4 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 05/16] mmc: sdhci-dove: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 07/16] mmc: sdhci-iproc: " Adrian Hunter
` (11 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci_f_sdh30.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 47ae853f51aa..c58e7cb1e2a7 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -214,7 +214,7 @@ static void sdhci_f_sdh30_remove(struct platform_device *pdev)
struct reset_control *rst = priv->rst;
struct clk *clk = priv->clk;
- sdhci_pltfm_unregister(pdev);
+ sdhci_pltfm_remove(pdev);
reset_control_assert(rst);
clk_disable_unprepare(clk);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 07/16] mmc: sdhci-iproc: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (5 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 06/16] mmc: sdhci_f_sdh30: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 08/16] mmc: sdhci-of-arasan: " Adrian Hunter
` (10 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-iproc.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index b1547bcbec32..10235fdff246 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -386,16 +386,11 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
host->mmc->caps |= iproc_host->data->mmc_caps;
if (dev->of_node) {
- pltfm_host->clk = devm_clk_get(dev, NULL);
+ pltfm_host->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(pltfm_host->clk)) {
ret = PTR_ERR(pltfm_host->clk);
goto err;
}
- ret = clk_prepare_enable(pltfm_host->clk);
- if (ret) {
- dev_err(dev, "failed to enable host clk\n");
- goto err;
- }
}
if (iproc_host->data->missing_caps) {
@@ -406,13 +401,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
ret = sdhci_add_host(host);
if (ret)
- goto err_clk;
+ goto err;
return 0;
-err_clk:
- if (dev->of_node)
- clk_disable_unprepare(pltfm_host->clk);
err:
sdhci_pltfm_free(pdev);
return ret;
@@ -432,7 +424,7 @@ static struct platform_driver sdhci_iproc_driver = {
.pm = &sdhci_pltfm_pmops,
},
.probe = sdhci_iproc_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
.shutdown = sdhci_iproc_shutdown,
};
module_platform_driver(sdhci_iproc_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 08/16] mmc: sdhci-of-arasan: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (6 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 07/16] mmc: sdhci-iproc: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 09/16] mmc: sdhci-of-at91: " Adrian Hunter
` (9 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-arasan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 15025af326a2..5edd024347bd 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -2022,6 +2022,7 @@ static void sdhci_arasan_remove(struct platform_device *pdev)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
struct clk *clk_ahb = sdhci_arasan->clk_ahb;
+ struct clk *clk_xin = pltfm_host->clk;
if (!IS_ERR(sdhci_arasan->phy)) {
if (sdhci_arasan->is_phy_on)
@@ -2031,8 +2032,9 @@ static void sdhci_arasan_remove(struct platform_device *pdev)
sdhci_arasan_unregister_sdclk(&pdev->dev);
- sdhci_pltfm_unregister(pdev);
+ sdhci_pltfm_remove(pdev);
+ clk_disable_unprepare(clk_xin);
clk_disable_unprepare(clk_ahb);
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 09/16] mmc: sdhci-of-at91: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (7 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 08/16] mmc: sdhci-of-arasan: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 10/16] mmc: sdhci-of-esdhc: " Adrian Hunter
` (8 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-at91.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index db01ea9fa203..23a9faad2ff8 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -456,7 +456,7 @@ static void sdhci_at91_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
- sdhci_pltfm_unregister(pdev);
+ sdhci_pltfm_remove(pdev);
clk_disable_unprepare(gck);
clk_disable_unprepare(hclock);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 10/16] mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (8 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 09/16] mmc: sdhci-of-at91: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 11/16] mmc: sdhci-of-hlwd: " Adrian Hunter
` (7 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-esdhc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 5072b59f6165..3ae9aa25745a 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -1521,7 +1521,7 @@ static struct platform_driver sdhci_esdhc_driver = {
.pm = &esdhc_of_dev_pm_ops,
},
.probe = sdhci_esdhc_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_esdhc_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 11/16] mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (9 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 10/16] mmc: sdhci-of-esdhc: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 12/16] mmc: sdhci-of-sparx5: " Adrian Hunter
` (6 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-hlwd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c
index cba3ba48e9dc..06e88bb22ea5 100644
--- a/drivers/mmc/host/sdhci-of-hlwd.c
+++ b/drivers/mmc/host/sdhci-of-hlwd.c
@@ -85,7 +85,7 @@ static struct platform_driver sdhci_hlwd_driver = {
.pm = &sdhci_pltfm_pmops,
},
.probe = sdhci_hlwd_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_hlwd_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 12/16] mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (10 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 11/16] mmc: sdhci-of-hlwd: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 13/16] mmc: sdhci-pxav2: " Adrian Hunter
` (5 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-sparx5.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-sparx5.c b/drivers/mmc/host/sdhci-of-sparx5.c
index 653480dbe6bb..64b77e7d14cd 100644
--- a/drivers/mmc/host/sdhci-of-sparx5.c
+++ b/drivers/mmc/host/sdhci-of-sparx5.c
@@ -184,15 +184,12 @@ static int sdhci_sparx5_probe(struct platform_device *pdev)
sdhci_sparx5 = sdhci_pltfm_priv(pltfm_host);
sdhci_sparx5->host = host;
- pltfm_host->clk = devm_clk_get(&pdev->dev, "core");
+ 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 core clk: %d\n", ret);
+ dev_err(&pdev->dev, "failed to get and enable core clk: %d\n", ret);
goto free_pltfm;
}
- ret = clk_prepare_enable(pltfm_host->clk);
- if (ret)
- goto free_pltfm;
if (!of_property_read_u32(np, "microchip,clock-delay", &value) &&
(value > 0 && value <= MSHC_DLY_CC_MAX))
@@ -202,13 +199,13 @@ static int sdhci_sparx5_probe(struct platform_device *pdev)
ret = mmc_of_parse(host->mmc);
if (ret)
- goto err_clk;
+ goto free_pltfm;
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 err_clk;
+ goto free_pltfm;
}
if (sdhci_sparx5->delay_clock >= 0)
@@ -225,7 +222,7 @@ static int sdhci_sparx5_probe(struct platform_device *pdev)
ret = sdhci_add_host(host);
if (ret)
- goto err_clk;
+ goto free_pltfm;
/* Set AXI bus master to use un-cached access (for DMA) */
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA) &&
@@ -239,8 +236,6 @@ static int sdhci_sparx5_probe(struct platform_device *pdev)
return ret;
-err_clk:
- clk_disable_unprepare(pltfm_host->clk);
free_pltfm:
sdhci_pltfm_free(pdev);
return ret;
@@ -260,7 +255,7 @@ static struct platform_driver sdhci_sparx5_driver = {
.pm = &sdhci_pltfm_pmops,
},
.probe = sdhci_sparx5_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_sparx5_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 13/16] mmc: sdhci-pxav2: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (11 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 12/16] mmc: sdhci-of-sparx5: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 14/16] mmc: sdhci-st: " Adrian Hunter
` (4 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
devm_clk_get_enabled() can be used for pltfm_host->clk.
This has the side effect that the order of operations on the error path
and remove path is not the same as it was before, but should be safe
nevertheless.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-pxav2.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index a0c8470e9214..b75cbea88b40 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -268,26 +268,21 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
pltfm_host = sdhci_priv(host);
pxav2_host = sdhci_pltfm_priv(pltfm_host);
- clk = devm_clk_get(dev, "io");
- if (IS_ERR(clk) && PTR_ERR(clk) != -EPROBE_DEFER)
- clk = devm_clk_get(dev, NULL);
+ 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;
}
pltfm_host->clk = clk;
- ret = clk_prepare_enable(clk);
- if (ret) {
- dev_err(dev, "failed to enable io clock\n");
- goto free;
- }
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 disable_clk;
+ goto free;
}
host->quirks = SDHCI_QUIRK_BROKEN_ADMA
@@ -339,12 +334,10 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
ret = sdhci_add_host(host);
if (ret)
- goto disable_clk;
+ goto free;
return 0;
-disable_clk:
- clk_disable_unprepare(clk);
free:
sdhci_pltfm_free(pdev);
return ret;
@@ -358,7 +351,7 @@ static struct platform_driver sdhci_pxav2_driver = {
.pm = &sdhci_pltfm_pmops,
},
.probe = sdhci_pxav2_probe,
- .remove_new = sdhci_pltfm_unregister,
+ .remove_new = sdhci_pltfm_remove,
};
module_platform_driver(sdhci_pxav2_driver);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 14/16] mmc: sdhci-st: Use sdhci_pltfm_remove()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (12 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 13/16] mmc: sdhci-pxav2: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 15/16] mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister() Adrian Hunter
` (3 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() because
sdhci_pltfm_unregister() is going to be removed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-st.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c
index 14fc2c386bd3..d12532b96b51 100644
--- a/drivers/mmc/host/sdhci-st.c
+++ b/drivers/mmc/host/sdhci-st.c
@@ -437,10 +437,12 @@ static void sdhci_st_remove(struct platform_device *pdev)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
struct reset_control *rstc = pdata->rstc;
+ struct clk *clk = pltfm_host->clk;
- sdhci_pltfm_unregister(pdev);
+ sdhci_pltfm_remove(pdev);
clk_disable_unprepare(pdata->icnclk);
+ clk_disable_unprepare(clk);
reset_control_assert(rstc);
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 15/16] mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (13 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 14/16] mmc: sdhci-st: " Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:03 ` [PATCH 16/16] mmc: sdhci-pltfm: Rename sdhci_pltfm_register() Adrian Hunter
` (2 subsequent siblings)
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Now that sdhci_pltfm_unregister() is unused, remove it.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-pltfm.c | 12 ------------
drivers/mmc/host/sdhci-pltfm.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 5a63c8818987..894f3bbe2b0f 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -187,18 +187,6 @@ int sdhci_pltfm_register(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
-void sdhci_pltfm_unregister(struct platform_device *pdev)
-{
- struct sdhci_host *host = platform_get_drvdata(pdev);
- struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
-
- sdhci_remove_host(host, dead);
- clk_disable_unprepare(pltfm_host->clk);
- sdhci_pltfm_free(pdev);
-}
-EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
-
void sdhci_pltfm_remove(struct platform_device *pdev)
{
struct sdhci_host *host = platform_get_drvdata(pdev);
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 402f4edc6ca5..bebc450d5098 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -102,7 +102,6 @@ extern void sdhci_pltfm_free(struct platform_device *pdev);
extern int sdhci_pltfm_register(struct platform_device *pdev,
const struct sdhci_pltfm_data *pdata,
size_t priv_size);
-extern void sdhci_pltfm_unregister(struct platform_device *pdev);
extern void sdhci_pltfm_remove(struct platform_device *pdev);
extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 16/16] mmc: sdhci-pltfm: Rename sdhci_pltfm_register()
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (14 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 15/16] mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister() Adrian Hunter
@ 2023-08-11 13:03 ` Adrian Hunter
2023-08-11 13:42 ` [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Andy Shevchenko
2023-08-15 11:40 ` Ulf Hansson
17 siblings, 0 replies; 20+ messages in thread
From: Adrian Hunter @ 2023-08-11 13:03 UTC (permalink / raw)
To: Ulf Hansson, Andy Shevchenko, Uwe Kleine-König, Yangtao Li
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Ray Jui, Eugen Hristev, Jassi Brar,
Christophe JAILLET, Georgii Kruglov, Michal Simek, Lars Povlsen,
Andy Tang, Scott Branden, linux-mmc, UNGLinuxDriver,
Claudiu Beznea
Now that sdhci_pltfm_unregister() has been removed, rename
sdhci_pltfm_register() to sdhci_pltfm_init_and_add_host() to better
reflect what it does.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-hlwd.c | 2 +-
drivers/mmc/host/sdhci-pltfm.c | 8 ++++----
drivers/mmc/host/sdhci-pltfm.h | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c
index 06e88bb22ea5..9c1c0ce610ef 100644
--- a/drivers/mmc/host/sdhci-of-hlwd.c
+++ b/drivers/mmc/host/sdhci-of-hlwd.c
@@ -68,7 +68,7 @@ static const struct sdhci_pltfm_data sdhci_hlwd_pdata = {
static int sdhci_hlwd_probe(struct platform_device *pdev)
{
- return sdhci_pltfm_register(pdev, &sdhci_hlwd_pdata, 0);
+ return sdhci_pltfm_init_and_add_host(pdev, &sdhci_hlwd_pdata, 0);
}
static const struct of_device_id sdhci_hlwd_of_match[] = {
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 894f3bbe2b0f..a72e123a585d 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -166,9 +166,9 @@ void sdhci_pltfm_free(struct platform_device *pdev)
}
EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
-int sdhci_pltfm_register(struct platform_device *pdev,
- const struct sdhci_pltfm_data *pdata,
- size_t priv_size)
+int sdhci_pltfm_init_and_add_host(struct platform_device *pdev,
+ const struct sdhci_pltfm_data *pdata,
+ size_t priv_size)
{
struct sdhci_host *host;
int ret = 0;
@@ -185,7 +185,7 @@ int sdhci_pltfm_register(struct platform_device *pdev,
return ret;
}
-EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
+EXPORT_SYMBOL_GPL(sdhci_pltfm_init_and_add_host);
void sdhci_pltfm_remove(struct platform_device *pdev)
{
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index bebc450d5098..b81d5b0fd616 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -99,9 +99,9 @@ extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
size_t priv_size);
extern void sdhci_pltfm_free(struct platform_device *pdev);
-extern int sdhci_pltfm_register(struct platform_device *pdev,
- const struct sdhci_pltfm_data *pdata,
- size_t priv_size);
+extern int sdhci_pltfm_init_and_add_host(struct platform_device *pdev,
+ const struct sdhci_pltfm_data *pdata,
+ size_t priv_size);
extern void sdhci_pltfm_remove(struct platform_device *pdev);
extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (15 preceding siblings ...)
2023-08-11 13:03 ` [PATCH 16/16] mmc: sdhci-pltfm: Rename sdhci_pltfm_register() Adrian Hunter
@ 2023-08-11 13:42 ` Andy Shevchenko
2023-08-15 11:40 ` Ulf Hansson
17 siblings, 0 replies; 20+ messages in thread
From: Andy Shevchenko @ 2023-08-11 13:42 UTC (permalink / raw)
To: Adrian Hunter
Cc: Ulf Hansson, Kunihiko Hayashi, Al Cooper, Li Zetao,
Alexandre Belloni, Brad Larson, Swati Agarwal, linux-kernel,
Sai Krishna Potthuri, Jiapeng Chong, Florian Fainelli,
Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Yangtao Li, Ray Jui, Uwe Kleine-König,
Eugen Hristev, Jassi Brar, Christophe JAILLET, Georgii Kruglov,
Michal Simek, Lars Povlsen, Andy Tang, Scott Branden, linux-mmc,
UNGLinuxDriver, Claudiu Beznea
On Fri, Aug 11, 2023 at 04:03:35PM +0300, Adrian Hunter wrote:
> Hi
>
> sdhci_pltfm_unregister() does:
>
> clk_disable_unprepare(pltfm_host->clk)
>
> which prevents drivers from using devm_clk_get_enabled() or similar.
>
> Move it out, and where drivers are doing devm_clk_get*() immediately
> followed by clk_prepare_enable(), combine them into devm_clk_get_*enabled().
>
> sdhci_pltfm_register() and sdhci_pltfm_unregister() are not paired functions.
> That are just helpers and effectively get renamed:
>
> sdhci_pltfm_register() -> sdhci_pltfm_init_and_add_host()
> sdhci_pltfm_unregister() -> sdhci_pltfm_remove()
>
> Please note, the patches are based on top of some
> "Convert to platform remove callback returning void"
> patches by Yangtao Li, which were posted here:
>
> https://lore.kernel.org/linux-mmc/20230727070051.17778-1-frank.li@vivo.com/
>
> Patches can also be found here:
>
> https://github.com/ahunter6/linux/commits/sdhci-pltfm-cleanup-1
All look good to me, thanks!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Adrian Hunter (16):
> mmc: sdhci-pltfm: Add sdhci_pltfm_remove()
> mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove()
> mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
> mmc: sdhci-cadence: Use sdhci_pltfm_remove()
> mmc: sdhci-dove: Use sdhci_pltfm_remove()
> mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove()
> mmc: sdhci-iproc: Use sdhci_pltfm_remove()
> mmc: sdhci-of-arasan: Use sdhci_pltfm_remove()
> mmc: sdhci-of-at91: Use sdhci_pltfm_remove()
> mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove()
> mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove()
> mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove()
> mmc: sdhci-pxav2: Use sdhci_pltfm_remove()
> mmc: sdhci-st: Use sdhci_pltfm_remove()
> mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister()
> mmc: sdhci-pltfm: Rename sdhci_pltfm_register()
>
> drivers/mmc/host/sdhci-bcm-kona.c | 12 +++++++++++-
> drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
> drivers/mmc/host/sdhci-cadence.c | 17 ++++-------------
> drivers/mmc/host/sdhci-dove.c | 8 ++------
> drivers/mmc/host/sdhci-iproc.c | 14 +++-----------
> drivers/mmc/host/sdhci-of-arasan.c | 4 +++-
> drivers/mmc/host/sdhci-of-at91.c | 2 +-
> drivers/mmc/host/sdhci-of-esdhc.c | 2 +-
> drivers/mmc/host/sdhci-of-hlwd.c | 4 ++--
> drivers/mmc/host/sdhci-of-sparx5.c | 17 ++++++-----------
> drivers/mmc/host/sdhci-pltfm.c | 14 ++++++--------
> drivers/mmc/host/sdhci-pltfm.h | 8 ++++----
> drivers/mmc/host/sdhci-pxav2.c | 19 ++++++-------------
> drivers/mmc/host/sdhci-st.c | 4 +++-
> drivers/mmc/host/sdhci_f_sdh30.c | 2 +-
> 15 files changed, 58 insertions(+), 87 deletions(-)
>
>
> Regards
> Adrian
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
` (16 preceding siblings ...)
2023-08-11 13:42 ` [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Andy Shevchenko
@ 2023-08-15 11:40 ` Ulf Hansson
17 siblings, 0 replies; 20+ messages in thread
From: Ulf Hansson @ 2023-08-15 11:40 UTC (permalink / raw)
To: Adrian Hunter
Cc: Alexandre Belloni, Kunihiko Hayashi, Al Cooper, Li Zetao,
Brad Larson, Swati Agarwal, linux-kernel, Sai Krishna Potthuri,
Jiapeng Chong, Florian Fainelli, Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Kamal Dasu, Doug Brown,
Daniel Machon, Yangtao Li, Ray Jui, Uwe Kleine-König,
Eugen Hristev, Jassi Brar, Christophe JAILLET, Georgii Kruglov,
Andy Shevchenko, Michal Simek, Lars Povlsen, Andy Tang,
Scott Branden, linux-mmc, UNGLinuxDriver, Claudiu Beznea
On Fri, 11 Aug 2023 at 15:04, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> Hi
>
> sdhci_pltfm_unregister() does:
>
> clk_disable_unprepare(pltfm_host->clk)
>
> which prevents drivers from using devm_clk_get_enabled() or similar.
>
> Move it out, and where drivers are doing devm_clk_get*() immediately
> followed by clk_prepare_enable(), combine them into devm_clk_get_*enabled().
>
> sdhci_pltfm_register() and sdhci_pltfm_unregister() are not paired functions.
> That are just helpers and effectively get renamed:
>
> sdhci_pltfm_register() -> sdhci_pltfm_init_and_add_host()
> sdhci_pltfm_unregister() -> sdhci_pltfm_remove()
>
> Please note, the patches are based on top of some
> "Convert to platform remove callback returning void"
> patches by Yangtao Li, which were posted here:
>
> https://lore.kernel.org/linux-mmc/20230727070051.17778-1-frank.li@vivo.com/
>
> Patches can also be found here:
>
> https://github.com/ahunter6/linux/commits/sdhci-pltfm-cleanup-1
>
>
> Adrian Hunter (16):
> mmc: sdhci-pltfm: Add sdhci_pltfm_remove()
> mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove()
> mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
> mmc: sdhci-cadence: Use sdhci_pltfm_remove()
> mmc: sdhci-dove: Use sdhci_pltfm_remove()
> mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove()
> mmc: sdhci-iproc: Use sdhci_pltfm_remove()
> mmc: sdhci-of-arasan: Use sdhci_pltfm_remove()
> mmc: sdhci-of-at91: Use sdhci_pltfm_remove()
> mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove()
> mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove()
> mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove()
> mmc: sdhci-pxav2: Use sdhci_pltfm_remove()
> mmc: sdhci-st: Use sdhci_pltfm_remove()
> mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister()
> mmc: sdhci-pltfm: Rename sdhci_pltfm_register()
>
> drivers/mmc/host/sdhci-bcm-kona.c | 12 +++++++++++-
> drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
> drivers/mmc/host/sdhci-cadence.c | 17 ++++-------------
> drivers/mmc/host/sdhci-dove.c | 8 ++------
> drivers/mmc/host/sdhci-iproc.c | 14 +++-----------
> drivers/mmc/host/sdhci-of-arasan.c | 4 +++-
> drivers/mmc/host/sdhci-of-at91.c | 2 +-
> drivers/mmc/host/sdhci-of-esdhc.c | 2 +-
> drivers/mmc/host/sdhci-of-hlwd.c | 4 ++--
> drivers/mmc/host/sdhci-of-sparx5.c | 17 ++++++-----------
> drivers/mmc/host/sdhci-pltfm.c | 14 ++++++--------
> drivers/mmc/host/sdhci-pltfm.h | 8 ++++----
> drivers/mmc/host/sdhci-pxav2.c | 19 ++++++-------------
> drivers/mmc/host/sdhci-st.c | 4 +++-
> drivers/mmc/host/sdhci_f_sdh30.c | 2 +-
> 15 files changed, 58 insertions(+), 87 deletions(-)
>
>
Applied for next, thanks!
Kind regards
Uffe
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 03/16] mmc: sdhci-brcmstb: Use sdhci_pltfm_remove()
2023-08-11 13:03 ` [PATCH 03/16] mmc: sdhci-brcmstb: " Adrian Hunter
@ 2023-08-25 16:22 ` Kamal Dasu
0 siblings, 0 replies; 20+ messages in thread
From: Kamal Dasu @ 2023-08-25 16:22 UTC (permalink / raw)
To: Adrian Hunter
Cc: Ulf Hansson, Kunihiko Hayashi, Al Cooper, Li Zetao,
Alexandre Belloni, Brad Larson, Swati Agarwal, linux-kernel,
Sai Krishna Potthuri, Jiapeng Chong, Florian Fainelli,
Steen Hegelund, Brian Norris,
Broadcom internal kernel review list, linux-arm-kernel,
Ye Xingchen, Patrice Chotard, Doug Brown, Daniel Machon,
Yangtao Li, Ray Jui, Uwe Kleine-König, Eugen Hristev,
Jassi Brar, Christophe JAILLET, Georgii Kruglov, Andy Shevchenko,
Michal Simek, Lars Povlsen, Andy Tang, Scott Branden, linux-mmc,
UNGLinuxDriver, Claudiu Beznea
[-- Attachment #1.1: Type: text/plain, Size: 2688 bytes --]
On Fri, Aug 11, 2023 at 9:04 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that
> devm_clk_get_optional_enabled() can be used for pltfm_host->clk.
>
> This has the side effect that the order of operations on the error path
> and remove path is not the same as it was before, but should be safe
> nevertheless.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by : Kamal Dasu <kamal.dasu@broadcom.com>
> ---
> drivers/mmc/host/sdhci-brcmstb.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
> index a2b6d8f2eeb6..c23251bb95f3 100644
> --- a/drivers/mmc/host/sdhci-brcmstb.c
> +++ b/drivers/mmc/host/sdhci-brcmstb.c
> @@ -264,23 +264,17 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
>
> dev_dbg(&pdev->dev, "Probe found match for %s\n", match->compatible);
>
> - clk = devm_clk_get_optional(&pdev->dev, NULL);
> + clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
> if (IS_ERR(clk))
> return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> - "Failed to get clock from Device Tree\n");
> -
> - res = clk_prepare_enable(clk);
> - if (res)
> - return res;
> + "Failed to get and enable clock from Device Tree\n");
>
> memset(&brcmstb_pdata, 0, sizeof(brcmstb_pdata));
> brcmstb_pdata.ops = match_priv->ops;
> host = sdhci_pltfm_init(pdev, &brcmstb_pdata,
> sizeof(struct sdhci_brcmstb_priv));
> - if (IS_ERR(host)) {
> - res = PTR_ERR(host);
> - goto err_clk;
> - }
> + if (IS_ERR(host))
> + return PTR_ERR(host);
>
> pltfm_host = sdhci_priv(host);
> priv = sdhci_pltfm_priv(pltfm_host);
> @@ -369,9 +363,7 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
>
> err:
> sdhci_pltfm_free(pdev);
> -err_clk:
> clk_disable_unprepare(base_clk);
> - clk_disable_unprepare(clk);
> return res;
> }
>
> @@ -430,7 +422,7 @@ static struct platform_driver sdhci_brcmstb_driver = {
> .of_match_table = of_match_ptr(sdhci_brcm_of_match),
> },
> .probe = sdhci_brcmstb_probe,
> - .remove_new = sdhci_pltfm_unregister,
> + .remove_new = sdhci_pltfm_remove,
> .shutdown = sdhci_brcmstb_shutdown,
> };
>
> --
> 2.34.1
>
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4203 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2023-08-25 16:23 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 13:03 [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Adrian Hunter
2023-08-11 13:03 ` [PATCH 01/16] mmc: sdhci-pltfm: Add sdhci_pltfm_remove() Adrian Hunter
2023-08-11 13:03 ` [PATCH 02/16] mmc: sdhci-bcm-kona: Use sdhci_pltfm_remove() Adrian Hunter
2023-08-11 13:03 ` [PATCH 03/16] mmc: sdhci-brcmstb: " Adrian Hunter
2023-08-25 16:22 ` Kamal Dasu
2023-08-11 13:03 ` [PATCH 04/16] mmc: sdhci-cadence: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 05/16] mmc: sdhci-dove: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 06/16] mmc: sdhci_f_sdh30: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 07/16] mmc: sdhci-iproc: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 08/16] mmc: sdhci-of-arasan: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 09/16] mmc: sdhci-of-at91: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 10/16] mmc: sdhci-of-esdhc: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 11/16] mmc: sdhci-of-hlwd: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 12/16] mmc: sdhci-of-sparx5: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 13/16] mmc: sdhci-pxav2: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 14/16] mmc: sdhci-st: " Adrian Hunter
2023-08-11 13:03 ` [PATCH 15/16] mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister() Adrian Hunter
2023-08-11 13:03 ` [PATCH 16/16] mmc: sdhci-pltfm: Rename sdhci_pltfm_register() Adrian Hunter
2023-08-11 13:42 ` [PATCH 00/16] mmc: sdhci-pltfm: Minor clean up Andy Shevchenko
2023-08-15 11:40 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).