From patchwork Thu Dec 18 09:41:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 42409 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4996126C6B for ; Thu, 18 Dec 2014 09:42:05 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf492227wgh.5 for ; Thu, 18 Dec 2014 01:42:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=UNFjfhegIe/HAGEguhtOfMILsuYpp/ZB09HCBM0lqUM=; b=PtrDRk//VRYJ0xBk38lP8r4hiIrwcFkaepBZCRxIu//v0r9ySvlRG2HMCtb/vkZMy2 5NhlCULFtKX0m8yU5ZeyWK4AvPjm5Sfeel+C6O6/UcMlxuDja5UP7kXAqkU6+BDsfGrD qt2y9zfOJ7AtZyLGO5Sj2IBbMxVo2AhJQvJ+jHe9Avr1ULCcKSPuqXlUye2xo/t5hrnF JT8dcujvQMGwwCL2qfva80cBXBB1DAHAMhUj3+fsnyr23SbpB/tA4O7Zh1bhdIb9mDRK l9z4H4xng/S1EbQUaq3h0LB+2RR1yuMaxqaKd4chQE6vPwLa5iWszjB74Z0yQdiIY8Pf qK0A== X-Gm-Message-State: ALoCoQmW95uhCTCDM8ak2cV5cBUb5kiV8b5rgOyGMBuU3kiLNnR7nKTd3OHkKpZcrUq/njAsqVnK X-Received: by 10.112.188.199 with SMTP id gc7mr184877lbc.6.1418895724465; Thu, 18 Dec 2014 01:42:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.194 with SMTP id g2ls1277419lam.3.gmail; Thu, 18 Dec 2014 01:42:04 -0800 (PST) X-Received: by 10.152.28.227 with SMTP id e3mr1274350lah.54.1418895724263; Thu, 18 Dec 2014 01:42:04 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id pd10si6237442lbc.128.2014.12.18.01.42.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 01:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so656905lbg.15 for ; Thu, 18 Dec 2014 01:42:03 -0800 (PST) X-Received: by 10.112.130.132 with SMTP id oe4mr1226534lbb.82.1418895723844; Thu, 18 Dec 2014 01:42:03 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1645895lbb; Thu, 18 Dec 2014 01:42:03 -0800 (PST) X-Received: by 10.194.78.204 with SMTP id d12mr2403330wjx.37.1418895719883; Thu, 18 Dec 2014 01:41:59 -0800 (PST) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com. [209.85.212.173]) by mx.google.com with ESMTPS id n13si11014184wjw.88.2014.12.18.01.41.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 01:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.212.173 as permitted sender) client-ip=209.85.212.173; Received: by mail-wi0-f173.google.com with SMTP id r20so1117157wiv.6 for ; Thu, 18 Dec 2014 01:41:59 -0800 (PST) X-Received: by 10.194.238.3 with SMTP id vg3mr2305649wjc.69.1418895719625; Thu, 18 Dec 2014 01:41:59 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id w10sm8256264wje.10.2014.12.18.01.41.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Dec 2014 01:41:59 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Chris Ball Subject: [PATCH 3/6] mmc: sdhci-of-esdhc: Handle error from mmc_of_parse() Date: Thu, 18 Dec 2014 10:41:41 +0100 Message-Id: <1418895704-25908-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418895704-25908-1-git-send-email-ulf.hansson@linaro.org> References: <1418895704-25908-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Since mmc_of_parse() may fail, let's deal with it and thus do proper error handling. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-of-esdhc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 8872c85..429bf41 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -362,13 +362,19 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) } /* call to generic mmc_of_parse to support additional capabilities */ - mmc_of_parse(host->mmc); + ret = mmc_of_parse(host->mmc); + if (ret) + goto err; + mmc_of_parse_voltage(np, &host->ocr_mask); ret = sdhci_add_host(host); if (ret) - sdhci_pltfm_free(pdev); + goto err; + return 0; + err: + sdhci_pltfm_free(pdev); return ret; }