Skip to contentSkip to conversation

mmc: wbsd: fix double mmc_free_host() in wbsd_init()

PATCH In review Yang Yingliang 2 participants 3 messages Aug 7, 2023 – Aug 9, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mmc: wbsd: fix double mmc_free_host() in wbsd_init()

mmc_free_host() has already be called in wbsd_free_mmc(), remove the mmc_free_host() in error path in wbsd_init().

Fixes dc5b9b50fc9d ("mmc: wbsd: fix return value check of mmc_add_host()")
---
 drivers/mmc/host/wbsd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mmc/host/wbsd.c +0 -2
index 521af9251f33..bf2a92fba0ed 100644
@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,
 
 		wbsd_release_resources(host);
 		wbsd_free_mmc(dev);
-
-		mmc_free_host(mmc);
 		return ret;
 	}
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 mmc: wbsd: remove unnecessary dev_set_drvdata()

Remove unnecessary dev_set_drvdata() in ->remove(), and in error path in ->probe(), the driver_data will be set to NULL in device_unbind_cleanup() in driver core code.

---
 drivers/mmc/host/wbsd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mmc/host/wbsd.c +0 -2
index bf2a92fba0ed..0589d169e8fb 100644
@@ -1264,8 +1264,6 @@ static void wbsd_free_mmc(struct device *dev)
 	del_timer_sync(&host->ignore_timer);
 
 	mmc_free_host(mmc);
-
-	dev_set_drvdata(dev, NULL);
 }
 
 /*
Signature · 1 line
2.25.1
#2 lore raw
In reply to Yang Yingliang
Quoted 6 lines · Yang Yingliang

mmc_free_host() has already be called in wbsd_free_mmc(), remove the mmc_free_host() in error path in wbsd_init().

Fixes dc5b9b50fc9d ("mmc: wbsd: fix return value check of mmc_add_host()")

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/wbsd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mmc/host/wbsd.c +0 -3
index 521af9251f33..bf2a92fba0ed 100644
@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,
 
                wbsd_release_resources(host);
                wbsd_free_mmc(dev);
-
-               mmc_free_host(mmc);
                return ret;
        }
 
--

2.25.1