From patchwork Thu Apr 4 05:55:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15890 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A8C0B23E2E for ; Thu, 4 Apr 2013 06:07:02 +0000 (UTC) Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by fiordland.canonical.com (Postfix) with ESMTP id 3315CA18C95 for ; Thu, 4 Apr 2013 06:07:02 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id a11sf3771824qen.9 for ; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=LKadnhM1jdMiIvb7sjf5gZiqtLF3SbGmA5sgd3DW1p0=; b=RHwrTzJSVgnjcQPeNCgVvtjm5rWHnx8XwwHsaDRSUQxX6zSYcT66jmMrxYNN7fPfws /+1/zTJA+Z9k4OCZxwxEnJ9fEzaoewEnmVJ0+ReaWw9ovNu8OB0Bp6qsb6pplGkCmLVm 6KApdPHjL1PI0t+52siDbs3DNgLfuFND1oenYvdCyXdCJynBlAfI9Hgj922ju3dE4nH5 0vBNiJ4Jq4qL993XItAgnIeIjVpAKYxuj/Qq7dWfMkAt6KlpA0oSwaNzR19pV+w9KQxr HawIkIH040fTOiJpSnfSn8HfKo09ccIhcihKdkx/2GZrkc4UlU4Ce26hsBqprAPSRa+y ADPQ== X-Received: by 10.224.157.1 with SMTP id z1mr2680700qaw.8.1365055621758; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.75 with SMTP id w11ls1373673qeb.84.gmail; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) X-Received: by 10.52.20.196 with SMTP id p4mr3031153vde.128.1365055621635; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id do1si7383411vdb.30.2013.04.03.23.07.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 23:07:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id m16so310247vca.28 for ; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) X-Received: by 10.52.21.212 with SMTP id x20mr3096137vde.106.1365055621468; Wed, 03 Apr 2013 23:07:01 -0700 (PDT) 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.58.85.136 with SMTP id h8csp201940vez; Wed, 3 Apr 2013 23:07:00 -0700 (PDT) X-Received: by 10.68.87.98 with SMTP id w2mr6824711pbz.190.1365055620182; Wed, 03 Apr 2013 23:07:00 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id io9si9542555pbc.108.2013.04.03.23.06.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 23:07:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id v14so1039870pde.4 for ; Wed, 03 Apr 2013 23:06:59 -0700 (PDT) X-Received: by 10.66.234.33 with SMTP id ub1mr7643655pac.29.1365055619600; Wed, 03 Apr 2013 23:06:59 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id 1sm8891928pbg.18.2013.04.03.23.06.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 23:06:58 -0700 (PDT) From: Sachin Kamat To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, tgih.jun@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v2 1/2] mmc: dw_mmc: Check return value of regulator_enable Date: Thu, 4 Apr 2013 11:25:10 +0530 Message-Id: <1365054911-19928-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkwHARKBpI82S+YITMeTVFyjcl9WvdalHxbzyUu7TXscNhpo/9md4FhaFGk9ug+qchc7xKK X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , regulator_enable() is declared with __must_check attribute. Hence check the return value to ensure that the regulator is enabled. Fixes the following warning: drivers/mmc/host/dw_mmc.c:2461:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_init_slot’: drivers/mmc/host/dw_mmc.c:1994:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Sachin Kamat Acked-by: Jaehoon Chung Acked-by: Seungwon Jeon --- Changes since v1: Changed 'if (ret != 0)' to 'if (ret)' --- drivers/mmc/host/dw_mmc.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a443820..4e3ebff 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1990,8 +1990,14 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (IS_ERR(host->vmmc)) { pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc)); host->vmmc = NULL; - } else - regulator_enable(host->vmmc); + } else { + ret = regulator_enable(host->vmmc); + if (ret) { + dev_err(host->dev, + "failed to enable regulator: %d\n", ret); + goto err_setup_bus; + } + } if (dw_mci_get_cd(mmc)) set_bit(DW_MMC_CARD_PRESENT, &slot->flags); @@ -2457,8 +2463,14 @@ int dw_mci_resume(struct dw_mci *host) { int i, ret; - if (host->vmmc) - regulator_enable(host->vmmc); + if (host->vmmc) { + ret = regulator_enable(host->vmmc); + if (ret) { + dev_err(host->dev, + "failed to enable regulator: %d\n", ret); + return ret; + } + } if (!mci_wait_reset(host->dev, host)) { ret = -ENODEV;