From patchwork Thu Mar 28 04:25:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15712 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 A3EDF23E00 for ; Thu, 28 Mar 2013 04:37:24 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id 557C8A185C9 for ; Thu, 28 Mar 2013 04:37:24 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id jz10so4903405veb.5 for ; Wed, 27 Mar 2013 21:37:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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:content-type:content-transfer-encoding :x-gm-message-state; bh=dsL2pfAgcubgTAcj4DYmtS/PHOw38fuGxYdSS23SReM=; b=ePCF01iDu2sGKaFlxoGznRpJux9hoNXcV4mo55YT+PcNlzUGt/ikvuTMB6xLiEM9sX Wvac//++07k4UwfVv4oWCVWtt9VSTuAO6HG4nlo7OXpyzpY7eo1Wj7VXxEPUqOAt7bxw nRmhhDzY/Zl7Sz3cn6tEC6Fzu/L56iVzoJzZkvvvabnPlArOY6WrN0IS+h9LpJh0Z6SJ RfbJliiKUarWD2KWjtDyR1txmc0+8Luo1KRM9T9W3xO2rESZBEaoBC0YQBhYG3aVXZZG 33llcEogzao96bo2NA4SA1pM88TtDGQLnw2FBh20OtG/xuB3620vJmuLuqeEtuidni+Y jbyA== X-Received: by 10.58.224.101 with SMTP id rb5mr26263624vec.17.1364445443831; Wed, 27 Mar 2013 21:37:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp145463ved; Wed, 27 Mar 2013 21:37:23 -0700 (PDT) X-Received: by 10.68.241.225 with SMTP id wl1mr33223868pbc.170.1364445442714; Wed, 27 Mar 2013 21:37:22 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id ak6si24745703pbd.14.2013.03.27.21.37.13 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 21:37:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pd0-f181.google.com with SMTP id q10so3870798pdj.26 for ; Wed, 27 Mar 2013 21:37:13 -0700 (PDT) X-Received: by 10.67.1.69 with SMTP id be5mr31143880pad.154.1364445433028; Wed, 27 Mar 2013 21:37:13 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id bs1sm13146991pbc.8.2013.03.27.21.37.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 21:37:12 -0700 (PDT) From: Sachin Kamat To: linux-mmc@vger.kernel.org Cc: tgih.jun@samsung.com, jh80.chung@samsung.com, cjb@laptop.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/2] mmc: dw_mmc: Check return value of regulator_enable Date: Thu, 28 Mar 2013 09:55:46 +0530 Message-Id: <1364444747-16777-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkMknuSLdGtZ4Ak8KmAyx+gDzA3o1PaTSJHm7RMDfGfd+ZHNtjvG/1xFH5oRjLOTp9vExze 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 --- drivers/mmc/host/dw_mmc.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a443820..1ba09d0 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 != 0) { + 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 != 0) { + dev_err(host->dev, + "failed to enable regulator: %d\n", ret); + return ret; + } + } if (!mci_wait_reset(host->dev, host)) { ret = -ENODEV;