Skip to contentSkip to conversation

mmc: Report failure reasons for all cases in sdhci_add_host()

PATCH In review Mark Brown 2 participants 2 messages Jul 2, 2012 – Jul 4, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mmc: Report failure reasons for all cases in sdhci_add_host()

For most error conditions sdhci_add_host() will print a diagnostic message indicating why it failed but there are a few cases where this does not happen. Add error messages in these cases to aid diagnosis.

---
 drivers/mmc/host/sdhci.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +8 -2
index caba999..acbc420 100644
@@ -3031,8 +3031,11 @@ int sdhci_add_host(struct sdhci_host *host)
 
 	ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
 		mmc_hostname(mmc), host);
-	if (ret)
+	if (ret) {
+		pr_err("%s: Failed to request IRQ %d: %d\n",
+		       mmc_hostname(mmc), host->irq, ret);
 		goto untasklet;
+	}
 
 	sdhci_init(host, 0);
 
@@ -3049,8 +3052,11 @@ int sdhci_add_host(struct sdhci_host *host)
 	host->led.brightness_set = sdhci_led_control;
 
 	ret = led_classdev_register(mmc_dev(mmc), &host->led);
-	if (ret)
+	if (ret) {
+		pr_err("%s: Failed to register LED device: %d\n",
+		       mmc_hostname(mmc), ret);
 		goto reset;
+	}
 #endif
 
 	mmiowb();
Signature · 1 line
1.7.10
#1 lore raw

Hi,

Quoted 29 lines · Mark Brown

For most error conditions sdhci_add_host() will print a diagnostic message indicating why it failed but there are a few cases where this does not happen. Add error messages in these cases to aid diagnosis.

---
 drivers/mmc/host/sdhci.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +4 -1
index caba999..acbc420 100644
@@ -3031,8 +3031,11 @@ int sdhci_add_host(struct sdhci_host *host)
 
 	ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
 		mmc_hostname(mmc), host);
-	if (ret)
+	if (ret) {
+		pr_err("%s: Failed to request IRQ %d: %d\n",
+		       mmc_hostname(mmc), host->irq, ret);
 		goto untasklet;
+	}
 
 	sdhci_init(host, 0);
 
@@ -3049,8 +3052,11 @@ int sdhci_add_host(struct sdhci_host *host)
 	host->led.brightness_set = sdhci_led_control;
 

drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 3062

Quoted 10 lines
drivers/mmc/host/sdhci.c +4 -1
 	ret = led_classdev_register(mmc_dev(mmc), &host->led);
-	if (ret)
+	if (ret) {
+		pr_err("%s: Failed to register LED device: %d\n",
+		       mmc_hostname(mmc), ret);
 		goto reset;
+	}
 #endif
 
 	mmiowb();

Thanks, pushed to mmc-next for 3.6.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child