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

From: Ulf Hansson

Date: Mon Sep 28 2026 - 11:55:59 EST


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.

Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxxxxxxxx>
---
drivers/mmc/host/cavium-thunderx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
index 84ff6d82ae3c..eecac003e546 100644
--- a/drivers/mmc/host/cavium-thunderx.c
+++ b/drivers/mmc/host/cavium-thunderx.c
@@ -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;
--
2.43.0