From patchwork Thu Aug 27 09:13:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 7082471 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 637569F372 for ; Thu, 27 Aug 2015 09:19:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AF1B20657 for ; Thu, 27 Aug 2015 09:19:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 932F72099F for ; Thu, 27 Aug 2015 09:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751992AbbH0JOY (ORCPT ); Thu, 27 Aug 2015 05:14:24 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:46719 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbbH0JOW (ORCPT ); Thu, 27 Aug 2015 05:14:22 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t7R9EHpq018056; Thu, 27 Aug 2015 04:14:17 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7R9EH5m020147; Thu, 27 Aug 2015 04:14:17 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 27 Aug 2015 04:14:17 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7R9E7aO004649; Thu, 27 Aug 2015 04:14:14 -0500 From: Kishon Vijay Abraham I To: , , , , , , CC: , Subject: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get Date: Thu, 27 Aug 2015 14:43:54 +0530 Message-ID: <1440666847-12594-3-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1440666847-12594-1-git-send-email-kishon@ti.com> References: <1440666847-12594-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now return error only if the return value of devm_regulator_get_optional() is not the same as -ENODEV, since with -EPROBE_DEFER, the regulator can be obtained later and all other errors are fatal. Signed-off-by: Kishon Vijay Abraham I Tested-by: Tony Lindgren --- drivers/mmc/host/omap_hsmmc.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 9b335af..2eafd6f 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -375,10 +375,28 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) /* Allow an aux regulator */ reg = devm_regulator_get_optional(host->dev, "vmmc_aux"); - host->vcc_aux = IS_ERR(reg) ? NULL : reg; + if (IS_ERR(reg)) { + ret = PTR_ERR(reg); + if (ret != -ENODEV) + return ret; + host->vcc_aux = NULL; + dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n", + PTR_ERR(reg)); + } else { + host->vcc_aux = reg; + } reg = devm_regulator_get_optional(host->dev, "pbias"); - host->pbias = IS_ERR(reg) ? NULL : reg; + if (IS_ERR(reg)) { + ret = PTR_ERR(reg); + if (ret != -ENODEV) + return ret; + host->pbias = NULL; + dev_dbg(host->dev, "unable to get pbias regulator %ld\n", + PTR_ERR(reg)); + } else { + host->pbias = reg; + } /* For eMMC do not power off when not in sleep state */ if (mmc_pdata(host)->no_regulator_off_init)