Commit 70a557e6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Ulf Hansson

mmc: mmc_spi: Remove useless NULL check at ->remove()

The mmc pointer can't be NULL at ->remove(), drop the useless check.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b9ffe408
...@@ -1499,31 +1499,27 @@ static int mmc_spi_probe(struct spi_device *spi) ...@@ -1499,31 +1499,27 @@ static int mmc_spi_probe(struct spi_device *spi)
static int mmc_spi_remove(struct spi_device *spi) static int mmc_spi_remove(struct spi_device *spi)
{ {
struct mmc_host *mmc = dev_get_drvdata(&spi->dev); struct mmc_host *mmc = dev_get_drvdata(&spi->dev);
struct mmc_spi_host *host; struct mmc_spi_host *host = mmc_priv(mmc);
if (mmc) {
host = mmc_priv(mmc);
/* prevent new mmc_detect_change() calls */ /* prevent new mmc_detect_change() calls */
if (host->pdata && host->pdata->exit) if (host->pdata && host->pdata->exit)
host->pdata->exit(&spi->dev, mmc); host->pdata->exit(&spi->dev, mmc);
mmc_remove_host(mmc); mmc_remove_host(mmc);
if (host->dma_dev) { if (host->dma_dev) {
dma_unmap_single(host->dma_dev, host->ones_dma, dma_unmap_single(host->dma_dev, host->ones_dma,
MMC_SPI_BLOCKSIZE, DMA_TO_DEVICE); MMC_SPI_BLOCKSIZE, DMA_TO_DEVICE);
dma_unmap_single(host->dma_dev, host->data_dma, dma_unmap_single(host->dma_dev, host->data_dma,
sizeof(*host->data), DMA_BIDIRECTIONAL); sizeof(*host->data), DMA_BIDIRECTIONAL);
} }
kfree(host->data); kfree(host->data);
kfree(host->ones); kfree(host->ones);
spi->max_speed_hz = mmc->f_max; spi->max_speed_hz = mmc->f_max;
mmc_free_host(mmc); mmc_free_host(mmc);
mmc_spi_put_pdata(spi); mmc_spi_put_pdata(spi);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment