Skip to content

Commit

Permalink
mmc: tmio: use mmc_can_gpio_cd() instead of checking TMIO_MMC_USE_GPI…
Browse files Browse the repository at this point in the history
…O_CD

To use a GPIO line for card detection, TMIO_MMC_USE_GPIO_CD is set
by a legacy board (arch/sh/boards/mach-ecovec24).

For DT platforms, the "cd-gpios" property is a legitimate way for that
in case the IP-builtin card detection can not be used for some reason.
mmc_of_parse() calls mmc_gpiod_request_cd() to set up ctx->cd_gpio if
the "cd-gpios" property is specified.

To cater to both cases, mmc_can_gpio_cd() is a correct way to check
which card detection logic is used.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
masahir0y authored and storulf committed Jan 12, 2018
1 parent 2a609ab commit de21dc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/tmio_mmc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
}
mmc->max_seg_size = mmc->max_req_size;

_host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
_host->native_hotplug = !(mmc_can_gpio_cd(mmc) ||
mmc->caps & MMC_CAP_NEEDS_POLL ||
!mmc_card_is_removable(mmc));

Expand Down

0 comments on commit de21dc1

Please sign in to comment.