mbox series

[00/16] mmc: sdhci-pltfm: Minor clean up

Message ID 20230811130351.7038-1-adrian.hunter@intel.com (mailing list archive)
Headers show
Series mmc: sdhci-pltfm: Minor clean up | expand

Message

Adrian Hunter Aug. 11, 2023, 1:03 p.m. UTC
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

Comments

Andy Shevchenko Aug. 11, 2023, 1:42 p.m. UTC | #1
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
Ulf Hansson Aug. 15, 2023, 11:40 a.m. UTC | #2
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