diff mbox

[5/6] mmc: omap_hsmmc: simplify card/cover detect isr

Message ID 1425385698-6588-6-git-send-email-afenkart@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andreas Fenkart March 3, 2015, 12:28 p.m. UTC
strip the card dectet logic from cover detect isr and vice versa
the generic mmc_gpio_cd_irqt isr, uses 200ms on removal/insertion,
hence that should be fine here as well

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
 drivers/mmc/host/omap_hsmmc.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

Comments

Ulf Hansson March 30, 2015, 9:34 a.m. UTC | #1
On 3 March 2015 at 13:28, Andreas Fenkart <afenkart@gmail.com> wrote:
> strip the card dectet logic from cover detect isr and vice versa
> the generic mmc_gpio_cd_irqt isr, uses 200ms on removal/insertion,
> hence that should be fine here as well
>
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>

Thanks! Applied.

Kind regards
Uffe

> ---
>  drivers/mmc/host/omap_hsmmc.c | 27 +++------------------------
>  1 file changed, 3 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index ed68e55..4f6fbe5 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1239,21 +1239,11 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
>  static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
>  {
>         struct omap_hsmmc_host *host = dev_id;
> -       int carddetect;
>
>         sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
>
> -       if (host->card_detect) {
> -               carddetect = host->card_detect(host->dev);
> -       } else {
> -               omap_hsmmc_protect_card(host);
> -               carddetect = -ENOSYS;
> -       }
> -
> -       if (carddetect)
> -               mmc_detect_change(host->mmc, (HZ * 200) / 1000);
> -       else
> -               mmc_detect_change(host->mmc, (HZ * 50) / 1000);
> +       omap_hsmmc_protect_card(host);
> +       mmc_detect_change(host->mmc, (HZ * 200) / 1000);
>         return IRQ_HANDLED;
>  }
>
> @@ -1263,19 +1253,8 @@ static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
>  static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
>  {
>         struct omap_hsmmc_host *host = dev_id;
> -       int carddetect;
> -
> -       if (host->card_detect)
> -               carddetect = host->card_detect(host->dev);
> -       else {
> -               omap_hsmmc_protect_card(host);
> -               carddetect = -ENOSYS;
> -       }
>
> -       if (carddetect)
> -               mmc_detect_change(host->mmc, (HZ * 200) / 1000);
> -       else
> -               mmc_detect_change(host->mmc, (HZ * 50) / 1000);
> +       mmc_detect_change(host->mmc, (HZ * 200) / 1000);
>         return IRQ_HANDLED;
>  }
>
> --
> 2.1.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ed68e55..4f6fbe5 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1239,21 +1239,11 @@  static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
 static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
 {
 	struct omap_hsmmc_host *host = dev_id;
-	int carddetect;
 
 	sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
 
-	if (host->card_detect) {
-		carddetect = host->card_detect(host->dev);
-	} else {
-		omap_hsmmc_protect_card(host);
-		carddetect = -ENOSYS;
-	}
-
-	if (carddetect)
-		mmc_detect_change(host->mmc, (HZ * 200) / 1000);
-	else
-		mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+	omap_hsmmc_protect_card(host);
+	mmc_detect_change(host->mmc, (HZ * 200) / 1000);
 	return IRQ_HANDLED;
 }
 
@@ -1263,19 +1253,8 @@  static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
 static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
 {
 	struct omap_hsmmc_host *host = dev_id;
-	int carddetect;
-
-	if (host->card_detect)
-		carddetect = host->card_detect(host->dev);
-	else {
-		omap_hsmmc_protect_card(host);
-		carddetect = -ENOSYS;
-	}
 
-	if (carddetect)
-		mmc_detect_change(host->mmc, (HZ * 200) / 1000);
-	else
-		mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+	mmc_detect_change(host->mmc, (HZ * 200) / 1000);
 	return IRQ_HANDLED;
 }