diff mbox

[RESEND,V3,6/8] mmc: tegra: handle mmc_of_parse() errors during probe

Message ID 1370808858-32241-7-git-send-email-gmbnomis@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Baatz June 9, 2013, 8:14 p.m. UTC
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sdhci-tegra.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Stephen Warren June 10, 2013, 9:11 p.m. UTC | #1
On 06/09/2013 02:14 PM, Simon Baatz wrote:
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>

Tested-by: Stephen Warren <swarren@nvidia.com>

(On Seaboard/Springbank board, i.e. Tegra20)

> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c

> +err_parse_dt:
>  err_power_req:
>  err_alloc_tegra_host:

Nit: It'd be nice if that new label got inserted into the middle of the
list, so err_power_req, err_parse_dt, err_alloc_tegra_host. That way if
we ever needed to add separate code there, they'd be in the right order
already. Still, this isn't worth fixing unless you have to repost for
some other reason I guess.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Baatz June 10, 2013, 10:02 p.m. UTC | #2
Hi Stephen,

On Mon, Jun 10, 2013 at 03:11:14PM -0600, Stephen Warren wrote:
> On 06/09/2013 02:14 PM, Simon Baatz wrote:
> > Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> 
> Tested-by: Stephen Warren <swarren@nvidia.com>

Thanks!
 
> (On Seaboard/Springbank board, i.e. Tegra20)
> 
> > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> 
> > +err_parse_dt:
> >  err_power_req:
> >  err_alloc_tegra_host:
> 
> Nit: It'd be nice if that new label got inserted into the middle of the
> list, so err_power_req, err_parse_dt, err_alloc_tegra_host. That way if
> we ever needed to add separate code there, they'd be in the right order
> already. Still, this isn't worth fixing unless you have to repost for
> some other reason I guess.

Yes, you are right. I updated the patch locally, so the update will
be in if I need to repost (or if the nicer version is explicitly
requested).

Since this change is only syntactical, I simply assume that your
Tested-by is still valid even with the change ;-)

- Simon
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index e0dba74..7eb62f8 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -205,7 +205,7 @@  static const struct of_device_id sdhci_tegra_dt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_tegra_dt_match);
 
-static void sdhci_tegra_parse_dt(struct device *dev)
+static int sdhci_tegra_parse_dt(struct device *dev)
 {
 	struct device_node *np = dev->of_node;
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -213,7 +213,7 @@  static void sdhci_tegra_parse_dt(struct device *dev)
 	struct sdhci_tegra *tegra_host = pltfm_host->priv;
 
 	tegra_host->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
-	mmc_of_parse(host->mmc);
+	return mmc_of_parse(host->mmc);
 }
 
 static int sdhci_tegra_probe(struct platform_device *pdev)
@@ -245,7 +245,9 @@  static int sdhci_tegra_probe(struct platform_device *pdev)
 	tegra_host->soc_data = soc_data;
 	pltfm_host->priv = tegra_host;
 
-	sdhci_tegra_parse_dt(&pdev->dev);
+	rc = sdhci_tegra_parse_dt(&pdev->dev);
+	if (rc)
+		goto err_parse_dt;
 
 	if (gpio_is_valid(tegra_host->power_gpio)) {
 		rc = gpio_request(tegra_host->power_gpio, "sdhci_power");
@@ -278,6 +280,7 @@  err_add_host:
 err_clk_get:
 	if (gpio_is_valid(tegra_host->power_gpio))
 		gpio_free(tegra_host->power_gpio);
+err_parse_dt:
 err_power_req:
 err_alloc_tegra_host:
 	sdhci_pltfm_free(pdev);