Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621120

[PATCH 1/2] mmc: slot-gpio: check cd_gpio before setting up cd_gpio_isr

From Jisheng Zhang <jszhang@marvell.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] mmc: slot-gpio: check cd_gpio before setting up cd_gpio_isr
Date 2017-04-11 12:30 +0200
Message-ID <tv1dD-5J4-3@gated-at.bofh.it> (permalink)
References <tv1dD-5J4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


slot-gpio knows more information than its user, such as whether there
is cd gpio_desc or not. While one of its user -- the common sdhci
driver doesn't know it. To prepare for next patch which will setup
sdhci's own isr for card-detect interrupts, we add the check before
setting up cd_gpio_isr.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/mmc/core/slot-gpio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index a8450a8701e4..42b260593955 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -162,6 +162,9 @@ void mmc_gpio_set_cd_isr(struct mmc_host *host,
 {
 	struct mmc_gpio *ctx = host->slot.handler_priv;
 
+	if (!ctx->cd_gpio)
+		return;
+
 	WARN_ON(ctx->cd_gpio_isr);
 	ctx->cd_gpio_isr = isr;
 }
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] provide isr for card-detect interrupts Jisheng Zhang <jszhang@marvell.com> - 2017-04-11 12:30 +0200
  [PATCH 1/2] mmc: slot-gpio: check cd_gpio before setting up cd_gpio_isr Jisheng Zhang <jszhang@marvell.com> - 2017-04-11 12:30 +0200
  [PATCH 2/2] mmc: sdhci: provide isr for card-detect interrupts Jisheng Zhang <jszhang@marvell.com> - 2017-04-11 12:30 +0200
    Re: [PATCH 2/2] mmc: sdhci: provide isr for card-detect interrupts Adrian Hunter <adrian.hunter@intel.com> - 2017-04-11 12:40 +0200
      Re: [PATCH 2/2] mmc: sdhci: provide isr for card-detect interrupts Jisheng Zhang <jszhang@marvell.com> - 2017-04-13 11:30 +0200

csiph-web