mmc: core: remove redundant card null check to mmc_can_sleep()
authorYue Hu <huyue2@yulong.com>
Fri, 15 Jan 2021 03:45:06 +0000 (11:45 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Feb 2021 10:54:46 +0000 (11:54 +0100)
Note that only _mmc_suspend() will call mmc_can_sleep(). And card is
checked before in mmc_can_poweroff_notify().

Signed-off-by: Yue Hu <huyue2@yulong.com>
Link: https://lore.kernel.org/r/20210115034506.646-1-zbestahu@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/mmc.c

index 54ab1c7405e58eaaa6bc191f6e1cda0bbc83b340..0d80b72ddde8199da3916f63d26ac4fd8551cb2d 100644 (file)
@@ -1895,7 +1895,7 @@ err:
 
 static int mmc_can_sleep(struct mmc_card *card)
 {
-       return (card && card->ext_csd.rev >= 3);
+       return card->ext_csd.rev >= 3;
 }
 
 static int mmc_sleep(struct mmc_host *host)