diff options
author | Binbin Zhou <zhoubinbin@loongson.cn> | 2025-06-03 20:28:21 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2025-06-24 12:43:24 +0200 |
commit | 71f118b427bbfe8a60e7f7c3550314ef2801bcc7 (patch) | |
tree | 6d7536c3dd8ba18b212f9569bc1fea1f1635212a | |
parent | 5a8af27596118f3e6a121059ac7ac8c299bee164 (diff) |
mmc: mmc_spi: Use devm_mmc_alloc_host() helper
Use new function devm_mmc_alloc_host() to simplify the code.
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/3f1127f02ffd7f1cc09122fd0d3c71473a030a53.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/mmc_spi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 47443fb5eb33..35b0ad273b4f 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1185,7 +1185,7 @@ static int mmc_spi_probe(struct spi_device *spi) goto nomem; memset(ones, 0xff, MMC_SPI_BLOCKSIZE); - mmc = mmc_alloc_host(sizeof(*host), &spi->dev); + mmc = devm_mmc_alloc_host(&spi->dev, sizeof(*host)); if (!mmc) goto nomem; @@ -1305,7 +1305,6 @@ fail_glue_init: kfree(host->data); fail_nobuf1: mmc_spi_put_pdata(spi); - mmc_free_host(mmc); nomem: kfree(ones); return status; @@ -1328,7 +1327,6 @@ static void mmc_spi_remove(struct spi_device *spi) spi->max_speed_hz = mmc->f_max; mmc_spi_put_pdata(spi); - mmc_free_host(mmc); } static const struct spi_device_id mmc_spi_dev_ids[] = { |