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

sh: kfr2r09: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag

TMIO_MMC_WRPROTECT_DISABLE is equivalent to MMC_CAP2_NO_WRITE_PROTECT.

The flag is propagated as follows:
tmio_mmc_data::capabilities2 -> mmc_host::caps2

Only the difference is the TMIO_... makes tmio_mmc_get_ro() return 0
(i.e. it does not affect mmc_gpio_get_ro() at all), while MMC_CAP2_...
returns 0 before calling ->get_ro() hook (i.e. it affects both IP own
logic and GPIO detection).

The TMIO MMC drivers do not set-up gpio_ro by themselves, so gpio_ro
is obviously unused by legacy boards like this. So, this conversion
should be safe.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

authored by

Masahiro Yamada and committed by
Ulf Hansson
3ca1507b 2ad1db05

+1 -1
+1 -1
arch/sh/boards/mach-kfr2r09/setup.c
··· 375 375 static struct tmio_mmc_data sh7724_sdhi0_data = { 376 376 .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX, 377 377 .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX, 378 - .flags = TMIO_MMC_WRPROTECT_DISABLE, 379 378 .capabilities = MMC_CAP_SDIO_IRQ, 379 + .capabilities2 = MMC_CAP2_NO_WRITE_PROTECT, 380 380 }; 381 381 382 382 static struct platform_device kfr2r09_sh_sdhi0_device = {