Skip to content

Commit 94fe258

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Linus Walleij <[email protected]>
1 parent 04f2f45 commit 94fe258

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mmc/core/core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,8 +1815,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
18151815
unsigned int rem, to = from + nr;
18161816
int err;
18171817

1818-
if (!(card->host->caps & MMC_CAP_ERASE) ||
1819-
!(card->csd.cmdclass & CCC_ERASE))
1818+
if (!(card->csd.cmdclass & CCC_ERASE))
18201819
return -EOPNOTSUPP;
18211820

18221821
if (!card->erase_size)
@@ -1872,8 +1871,7 @@ EXPORT_SYMBOL(mmc_erase);
18721871

18731872
int mmc_can_erase(struct mmc_card *card)
18741873
{
1875-
if ((card->host->caps & MMC_CAP_ERASE) &&
1876-
(card->csd.cmdclass & CCC_ERASE) && card->erase_size)
1874+
if (card->csd.cmdclass & CCC_ERASE && card->erase_size)
18771875
return 1;
18781876
return 0;
18791877
}

0 commit comments

Comments
 (0)