Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: core: Enable erase/discard/trim support for all mmc hosts

Step by step, mmc host drivers and the mmc core have been improved in
regards to support erase/discard/trim operations. We have now reached a
point when it no longer seems reasonable to use an opt-in approach to
enable the functionality. Therefore, let's switch to make the operations
always supported.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200508112853.23525-1-ulf.hansson@linaro.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

+2 -4
+2 -4
drivers/mmc/core/core.c
··· 1815 1815 unsigned int rem, to = from + nr; 1816 1816 int err; 1817 1817 1818 - if (!(card->host->caps & MMC_CAP_ERASE) || 1819 - !(card->csd.cmdclass & CCC_ERASE)) 1818 + if (!(card->csd.cmdclass & CCC_ERASE)) 1820 1819 return -EOPNOTSUPP; 1821 1820 1822 1821 if (!card->erase_size) ··· 1871 1872 1872 1873 int mmc_can_erase(struct mmc_card *card) 1873 1874 { 1874 - if ((card->host->caps & MMC_CAP_ERASE) && 1875 - (card->csd.cmdclass & CCC_ERASE) && card->erase_size) 1875 + if (card->csd.cmdclass & CCC_ERASE && card->erase_size) 1876 1876 return 1; 1877 1877 return 0; 1878 1878 }