From patchwork Mon May 20 23:01:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Baatz X-Patchwork-Id: 2595141 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0D31240B0D for ; Mon, 20 May 2013 23:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758080Ab3ETXCg (ORCPT ); Mon, 20 May 2013 19:02:36 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.162]:27896 "EHLO mo-p00-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757094Ab3ETXCc (ORCPT ); Mon, 20 May 2013 19:02:32 -0400 X-RZG-AUTH: :L20Qdkipd/NtQfa28f3iP6nsj1VEm6lxnnjU56eNUnjyVKhsoRrRYQqTg2VsKWBjXOD8qSDlEoJr1es= X-RZG-CLASS-ID: mo00 Received: from gandalf.schnuecks.de ([2001:4dd0:f8d2:2602::1]) by smtp.strato.de (jorabe mo32) (RZmta 31.27 AUTH) with (DHE-RSA-AES256-SHA encrypted) ESMTPA id V04673p4KM24KQ ; Tue, 21 May 2013 01:02:31 +0200 (CEST) Received: by gandalf.schnuecks.de (Postfix, from userid 500) id 7DA0A4014B; Tue, 21 May 2013 01:02:30 +0200 (CEST) From: Simon Baatz To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: Jason Cooper , Andrew Lunn , Chris Ball , Guennadi Liakhovetski , Thomas Petazzoni , Ulf Hansson Subject: [PATCH V3 06/10] mmc: tegra: handle mmc_of_parse() errors during probe Date: Tue, 21 May 2013 01:01:47 +0200 Message-Id: <1369090911-1479-7-git-send-email-gmbnomis@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1369090911-1479-1-git-send-email-gmbnomis@gmail.com> References: <1369090911-1479-1-git-send-email-gmbnomis@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Signed-off-by: Simon Baatz --- drivers/mmc/host/sdhci-tegra.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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);