Skip to contentSkip to conversation

mmc: cavium-thunderx: Drop redundant calls to get|put_device()

PATCH New Ulf Hansson 1 participant 1 message Sep 28

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

PATCH 1/1 mmc: cavium-thunderx: Drop redundant calls to get|put_device()

Since commit 522811e944ed ("of: platform: stop accessing invalid dev in of_platform_device_destroy"), there is no need to take a reference for the device before calling of_platform_device_destroy(), hence let's drop this.

---
 drivers/mmc/host/cavium-thunderx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/cavium-thunderx.c +1 -4
index 84ff6d82ae3c..eecac003e546 100644
@@ -157,11 +157,8 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
 	for (i = 0; i < CAVIUM_MAX_MMC; i++) {
 		if (host->slot[i])
 			cvm_mmc_of_slot_remove(host->slot[i]);
-		if (host->slot_pdev[i]) {
-			get_device(&host->slot_pdev[i]->dev);
+		if (host->slot_pdev[i])
 			of_platform_device_destroy(&host->slot_pdev[i]->dev, NULL);
-			put_device(&host->slot_pdev[i]->dev);
-		}
 	}
 	clk_disable_unprepare(host->clk);
 	return ret;
Signature · 1 line
2.43.0