* [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq
@ 2017-01-10 15:10 Ulf Hansson
2017-01-17 15:08 ` Ulf Hansson
2017-01-17 20:53 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Ulf Hansson @ 2017-01-10 15:10 UTC (permalink / raw)
To: linux-mmc, Ulf Hansson; +Cc: Wolfram Sang, Simon Horman
To validate whether native hotplug needs to be used, the tmio driver checks
whether the mmc->slot.cd_irq has been successfully assigned.
This check is redundant at its current place in tmio_mmc_host_probe(), as
the mmc core assigns mmc->slot.cd_irq a valid value first when
mmc_gpiod_request_cd_irq() is called. Therefore, let's just remove the
check for now, as that also removes a layering violation of the tmio driver
accessing core specific data via ->slot.cd_irq.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/tmio_mmc_pio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 3ca97f3..0ef5780 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1177,8 +1177,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
_host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
mmc->caps & MMC_CAP_NEEDS_POLL ||
- !mmc_card_is_removable(mmc) ||
- mmc->slot.cd_irq >= 0);
+ !mmc_card_is_removable(mmc));
/*
* On Gen2+, eMMC with NONREMOVABLE currently fails because native
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq
2017-01-10 15:10 [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq Ulf Hansson
@ 2017-01-17 15:08 ` Ulf Hansson
2017-01-17 20:53 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2017-01-17 15:08 UTC (permalink / raw)
To: linux-mmc@vger.kernel.org, Ulf Hansson; +Cc: Wolfram Sang, Simon Horman
On 10 January 2017 at 16:10, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> To validate whether native hotplug needs to be used, the tmio driver checks
> whether the mmc->slot.cd_irq has been successfully assigned.
>
> This check is redundant at its current place in tmio_mmc_host_probe(), as
> the mmc core assigns mmc->slot.cd_irq a valid value first when
> mmc_gpiod_request_cd_irq() is called. Therefore, let's just remove the
> check for now, as that also removes a layering violation of the tmio driver
> accessing core specific data via ->slot.cd_irq.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
I have applied this for next, to get it tested.
Wolfram, Simon, please tell if you see any issues!
Kind regards
Uffe
> ---
> drivers/mmc/host/tmio_mmc_pio.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index 3ca97f3..0ef5780 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -1177,8 +1177,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
>
> _host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
> mmc->caps & MMC_CAP_NEEDS_POLL ||
> - !mmc_card_is_removable(mmc) ||
> - mmc->slot.cd_irq >= 0);
> + !mmc_card_is_removable(mmc));
>
> /*
> * On Gen2+, eMMC with NONREMOVABLE currently fails because native
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq
2017-01-10 15:10 [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq Ulf Hansson
2017-01-17 15:08 ` Ulf Hansson
@ 2017-01-17 20:53 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-01-17 20:53 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, Wolfram Sang, Simon Horman
On Tue, Jan 10, 2017 at 04:10:52PM +0100, Ulf Hansson wrote:
> To validate whether native hotplug needs to be used, the tmio driver checks
> whether the mmc->slot.cd_irq has been successfully assigned.
>
> This check is redundant at its current place in tmio_mmc_host_probe(), as
> the mmc core assigns mmc->slot.cd_irq a valid value first when
> mmc_gpiod_request_cd_irq() is called. Therefore, let's just remove the
> check for now, as that also removes a layering violation of the tmio driver
> accessing core specific data via ->slot.cd_irq.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Agreed. This is a layering violation and can be safely removed since it
is a no-op currently.
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Besides card eject still works on my M3-W. I will test on my H2 tomorrow
or the day after that.
Thanks,
Wolfram
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-17 21:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-10 15:10 [PATCH] mmc: tmio: Remove redundant check of mmc->slot.cd_irq Ulf Hansson
2017-01-17 15:08 ` Ulf Hansson
2017-01-17 20:53 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).