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: 2354121 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E5C06DF2A1 for ; Thu, 28 Mar 2013 04:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751173Ab3C1EhO (ORCPT ); Thu, 28 Mar 2013 00:37:14 -0400 Received: from mail-da0-f53.google.com ([209.85.210.53]:44065 "EHLO mail-da0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163Ab3C1EhN (ORCPT ); Thu, 28 Mar 2013 00:37:13 -0400 Received: by mail-da0-f53.google.com with SMTP id n34so3245974dal.26 for ; Wed, 27 Mar 2013 21:37:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=hySLtnchCfwO+s9j8EIqfzeBx+8EAkGzOlbJB5s6jyH5mMiRJMVuSYodPlawnw5vWp q7d/IhDD1gJ261d5np+lCLA+xykQtEuPdEZSAJDngYDQau1+Djpp30MpLskakWezBMF3 lWHpnOJBew2Ks5kC3kZMDbITGzbiwOtVXIJv+9fSpTIMpDiDiJwi8Ow5f21UXcuSI8V9 VKePhEOhUEAt0Nw3dKALx1q5LKlvgwB3nm7BlSvHxEBoX07da1v5WZ7S6hrMwJp3jpwU mM6m51fLZ3TJOhn8PtjhMOlIAJXh1ZT6ETsp8Sjp9yEoNMRqyVhBr47gwVGf7inEY45m sBqQ== 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: ALoCoQl9iMnWGz+QmgoMloNesaLYTFCR5amSgocvDHYjDOIOiOzgg80UmwHSfPnn6wJWrZjmFHbk Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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;