Commit 6b28f2c4 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Ulf Hansson
Browse files

mmc: moxart: remove unneeded check for drvdata



The 'struct mmc_host *mmc' comes from drvdata set at the end of probe,
so it cannot be NULL.  The code already dereferences it few lines before
the check with mmc_priv().  This also fixes smatch warning:

  drivers/mmc/host/moxart-mmc.c:692 moxart_remove() warn: variable dereferenced before check 'mmc' (see line 688)

Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200923153739.30327-1-krzk@kernel.org


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent fbb31330
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -689,7 +689,6 @@ static int moxart_remove(struct platform_device *pdev)

	dev_set_drvdata(&pdev->dev, NULL);

	if (mmc) {
	if (!IS_ERR(host->dma_chan_tx))
		dma_release_channel(host->dma_chan_tx);
	if (!IS_ERR(host->dma_chan_rx))
@@ -701,7 +700,7 @@ static int moxart_remove(struct platform_device *pdev)
	writel(0, host->base + REG_POWER_CONTROL);
	writel(readl(host->base + REG_CLOCK_CONTROL) | CLK_OFF,
	       host->base + REG_CLOCK_CONTROL);
	}

	return 0;
}