[v2,16/61] mmc: rtsx_pci: Drop if block with always false condition

Message ID 20230726040041.26267-16-frank.li@vivo.com
State New
Headers
Series [v2,01/61] mmc: sunxi: Convert to platform remove callback returning void |

Commit Message

李扬韬 July 26, 2023, 3:59 a.m. UTC
  rtsx_pci_sdmmc_drv_remove() is only called for a device after
rtsx_pci_sdmmc_drv_probe() returned 0. In that case platform_set_drvdata()
was called with a non-NULL value and so platform_get_drvdata()
won't return NULL.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Uwe Kleine-König July 26, 2023, 6:47 a.m. UTC | #1
On Wed, Jul 26, 2023 at 11:59:56AM +0800, Yangtao Li wrote:
> rtsx_pci_sdmmc_drv_remove() is only called for a device after
> rtsx_pci_sdmmc_drv_probe() returned 0. In that case platform_set_drvdata()
> was called with a non-NULL value and so platform_get_drvdata()
> won't return NULL.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe
  

Patch

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 8098726dcc0b..062d07c2ae5e 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1529,9 +1529,6 @@  static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
 	struct rtsx_pcr *pcr;
 	struct mmc_host *mmc;
 
-	if (!host)
-		return 0;
-
 	pcr = host->pcr;
 	pcr->slots[RTSX_SD_CARD].p_dev = NULL;
 	pcr->slots[RTSX_SD_CARD].card_event = NULL;