Skip to contentSkip to conversation

mmc: sdhci-s3c: remove the duplicated calling sequence

PATCH Superseded Jaehoon Chung 2 participants 2 messages Jun 25, 2013

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 4/4 mmc: sdhci-s3c: remove the duplicated calling sequence

Didn't need to call the sdhci_s3c_notify_change in setup_card_detect_gpio().

---
 drivers/mmc/host/sdhci-s3c.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci-s3c.c +12 -14
index f1d5965..64defad 100644
@@ -409,20 +409,18 @@ static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc)
 	if (devm_gpio_request(dev, pdata->ext_cd_gpio, "SDHCI EXT CD") == 0) {
 		sc->ext_cd_gpio = pdata->ext_cd_gpio;
 		sc->ext_cd_irq = gpio_to_irq(pdata->ext_cd_gpio);
-		if (sc->ext_cd_irq &&
-		    request_threaded_irq(sc->ext_cd_irq, NULL,
-					 sdhci_s3c_gpio_card_detect_thread,
-					 IRQF_TRIGGER_RISING |
-					 IRQF_TRIGGER_FALLING |
-					 IRQF_ONESHOT,
-					 dev_name(dev), sc) == 0) {
-			int status = gpio_get_value(sc->ext_cd_gpio);
-			if (pdata->ext_cd_gpio_invert)
-				status = !status;
-			sdhci_s3c_notify_change(sc->pdev, status);
-		} else {
-			dev_warn(dev, "cannot request irq for card detect\n");
-			sc->ext_cd_irq = 0;
+		if (sc->ext_cd_irq) {
+			ret = request_threaded_irq(sc->ext_cd_irq, NULL,
+					sdhci_s3c_gpio_card_detect_thread,
+					IRQF_TRIGGER_RISING |
+					IRQF_TRIGGER_FALLING |
+					IRQF_ONESHOT,
+					dev_name(dev), sc);
+			if (ret) {
+				dev_warn(dev,
+					"cannot request irq for card detect\n");
+				sc->ext_cd_irq = 0;
+			}
 		}
 	} else {
 		dev_err(dev, "cannot request gpio for card detect\n");
Signature · 1 line
1.7.9.5
Acked-by Tested-by on v1 4/4
#1 lore raw

Am Dienstag, 25. Juni 2013, 03:20:59 schrieb Jaehoon Chung:

Quoted 5 lines

Didn't need to call the sdhci_s3c_notify_change in setup_card_detect_gpio().

with the issue below addressed:

and on a s3c2416

Quoted 18 lines
---
 drivers/mmc/host/sdhci-s3c.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci-s3c.c +0 -0
index f1d5965..64defad 100644
@@ -409,20 +409,18 @@ static void sdhci_s3c_setup_card_detect_gpio(struct

sdhci_s3c *sc) if (devm_gpio_request(dev, pdata->ext_cd_gpio, "SDHCI EXT CD") == 0) { sc->ext_cd_gpio = pdata->ext_cd_gpio;

drivers/mmc/host/sdhci-s3c.c +0 -6
 		sc->ext_cd_irq = gpio_to_irq(pdata->ext_cd_gpio);
-		if (sc->ext_cd_irq &&
-		    request_threaded_irq(sc->ext_cd_irq, NULL,
-					 sdhci_s3c_gpio_card_detect_thread,
-					 IRQF_TRIGGER_RISING |
-					 IRQF_TRIGGER_FALLING |
-					 IRQF_ONESHOT,

drivers/mmc/host/sdhci-s3c.c static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc) · line 413

Quoted 10 lines
drivers/mmc/host/sdhci-s3c.c +2 -8
-					 dev_name(dev), sc) == 0) {
-			int status = gpio_get_value(sc->ext_cd_gpio);
-			if (pdata->ext_cd_gpio_invert)
-				status = !status;
-			sdhci_s3c_notify_change(sc->pdev, status);
-		} else {
-			dev_warn(dev, "cannot request irq for card detect\n");
-			sc->ext_cd_irq = 0;
+		if (sc->ext_cd_irq) {
+			ret = request_threaded_irq(sc->ext_cd_irq, NULL,

when testing on linux-next from 20130624 I get a
ret undeclared here.

Quoted 13 lines
drivers/mmc/host/sdhci-s3c.c +10 -0
+					sdhci_s3c_gpio_card_detect_thread,
+					IRQF_TRIGGER_RISING |
+					IRQF_TRIGGER_FALLING |
+					IRQF_ONESHOT,
+					dev_name(dev), sc);
+			if (ret) {
+				dev_warn(dev,
+					"cannot request irq for card detect\n");
+				sc->ext_cd_irq = 0;
+			}
 		}
 	} else {
 		dev_err(dev, "cannot request gpio for card detect\n");