mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
mmc: core: use the defined function to check whether card is removable
In linux/mmc/host.h, mmc_card_is_removable() is already defined. There is no reason that it doesn't use. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
d1a13c5ed3
commit
6067bafe44
1 changed files with 4 additions and 5 deletions
|
@ -2532,7 +2532,7 @@ int mmc_detect_card_removed(struct mmc_host *host)
|
||||||
if (!card)
|
if (!card)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (host->caps & MMC_CAP_NONREMOVABLE)
|
if (!mmc_card_is_removable(host))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = mmc_card_removed(card);
|
ret = mmc_card_removed(card);
|
||||||
|
@ -2570,7 +2570,7 @@ void mmc_rescan(struct work_struct *work)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If there is a non-removable card registered, only scan once */
|
/* If there is a non-removable card registered, only scan once */
|
||||||
if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered)
|
if (!mmc_card_is_removable(host) && host->rescan_entered)
|
||||||
return;
|
return;
|
||||||
host->rescan_entered = 1;
|
host->rescan_entered = 1;
|
||||||
|
|
||||||
|
@ -2587,8 +2587,7 @@ void mmc_rescan(struct work_struct *work)
|
||||||
* if there is a _removable_ card registered, check whether it is
|
* if there is a _removable_ card registered, check whether it is
|
||||||
* still present
|
* still present
|
||||||
*/
|
*/
|
||||||
if (host->bus_ops && !host->bus_dead
|
if (host->bus_ops && !host->bus_dead && mmc_card_is_removable(host))
|
||||||
&& !(host->caps & MMC_CAP_NONREMOVABLE))
|
|
||||||
host->bus_ops->detect(host);
|
host->bus_ops->detect(host);
|
||||||
|
|
||||||
host->detect_change = 0;
|
host->detect_change = 0;
|
||||||
|
@ -2613,7 +2612,7 @@ void mmc_rescan(struct work_struct *work)
|
||||||
mmc_bus_put(host);
|
mmc_bus_put(host);
|
||||||
|
|
||||||
mmc_claim_host(host);
|
mmc_claim_host(host);
|
||||||
if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
|
if (mmc_card_is_removable(host) && host->ops->get_cd &&
|
||||||
host->ops->get_cd(host) == 0) {
|
host->ops->get_cd(host) == 0) {
|
||||||
mmc_power_off(host);
|
mmc_power_off(host);
|
||||||
mmc_release_host(host);
|
mmc_release_host(host);
|
||||||
|
|
Loading…
Add table
Reference in a new issue