mmc: sdhci-bcm-kona: Use sdhci_pltfm_unregister instead of open coded
Subsystems (4)
PATCH 1/2 mmc: sdhci-bcm-kona: Use sdhci_pltfm_unregister instead of open coded
This avoid duplicated implementation and also fixes missing iounmap() and release_mem_region() calls in sdhci_bcm_kona_remove(). sdhci_pltfm_init() calls request_mem_region() and ioremap(), thus we need to call the corresponding iounmap() and release_mem_region() calls in sdhci_bcm_kona_remove().
--- drivers/mmc/host/sdhci-bcm-kona.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/mmc/host/sdhci-bcm-kona.c +1 -13
@@ -316,19 +316,7 @@ err_pltfm_free: static int __exit sdhci_bcm_kona_remove(struct platform_device *pdev) { -struct sdhci_host *host =platform_get_drvdata (pdev); -int dead; -u32 scratch; - - dead =0 ; - scratch =readl (host->ioaddr +SDHCI_INT_STATUS ); -if (scratch == (u32)-1 ) - dead =1 ; -sdhci_remove_host (host, dead); - -sdhci_free_host (host); - -return 0 ; +return sdhci_pltfm_unregister (pdev); }static struct platform_driver sdhci_bcm_kona_driver = {
Signature · 1 line
1.8.1.2
PATCH 2/2 mmc: sdhci-bcm2835: Use sdhci_pltfm_unregister instead of open coded
This avoid duplicated implementation.
--- drivers/mmc/host/sdhci-bcm2835.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/mmc/host/sdhci-bcm2835.c +1 -7
@@ -178,13 +178,7 @@ err:static int bcm2835_sdhci_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); - -return 0 ; +return sdhci_pltfm_unregister (pdev); }static const struct of_device_id bcm2835_sdhci_of_match[] = {
Signature · 1 line
1.8.1.2
Re: [PATCH 2/2] mmc: sdhci-bcm2835: Use sdhci_pltfm_unregister instead of open coded
Quoted 1 line · Axel Lin
This avoid duplicated implementation.
Quoted 26 lines · Axel Lin
This avoid duplicated implementation and also fixes missing
iounmap()andrelease_mem_region()calls insdhci_bcm_kona_remove().sdhci_pltfm_init()callsrequest_mem_region()andioremap(), thus we need to call the correspondingiounmap()andrelease_mem_region()calls insdhci_bcm_kona_remove().Signed-off-by Axel Lin <[email protected]>--- drivers/mmc/host/sdhci-bcm-kona.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)drivers/mmc/host/sdhci-bcm-kona.c +0
-7@@ -316,19 +316,7 @@ err_pltfm_free: static int __exit sdhci_bcm_kona_remove(struct platform_device *pdev) { -struct sdhci_host *host =platform_get_drvdata (pdev); -int dead; -u32 scratch; - - dead =0 ; - scratch =readl (host->ioaddr +SDHCI_INT_STATUS ); -if (scratch == (u32)-1 )
drivers/mmc/host/sdhci-bcm-kona.c err_pltfm_free: · line 322
Quoted 10 lines
drivers/mmc/host/sdhci-bcm-kona.c +1
-6- dead =1 ; -sdhci_remove_host (host, dead); - -sdhci_free_host (host); - -return 0 ; +return sdhci_pltfm_unregister (pdev); }static struct platform_driver sdhci_bcm_kona_driver = {
Thanks !
csd
Hi Axel,
Quoted 7 lines · Axel Lin
This avoid duplicated implementation and also fixes missing
iounmap()andrelease_mem_region()calls insdhci_bcm_kona_remove().sdhci_pltfm_init()callsrequest_mem_region()andioremap(), thus we need to call the correspondingiounmap()andrelease_mem_region()calls insdhci_bcm_kona_remove().Signed-off-by Axel Lin <[email protected]>
Thanks, pushed to mmc-next for 3.13.
- Chris.
Signature · 1 line
Chris Ball <[email protected]> <http://printf.net/>