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: 2390581 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 76809DF25A for ; Thu, 4 Apr 2013 06:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762593Ab3DDGHA (ORCPT ); Thu, 4 Apr 2013 02:07:00 -0400 Received: from mail-da0-f47.google.com ([209.85.210.47]:53901 "EHLO mail-da0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756261Ab3DDGHA (ORCPT ); Thu, 4 Apr 2013 02:07:00 -0400 Received: by mail-da0-f47.google.com with SMTP id s35so993860dak.20 for ; Wed, 03 Apr 2013 23:06:59 -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=LKadnhM1jdMiIvb7sjf5gZiqtLF3SbGmA5sgd3DW1p0=; b=mTHW2y7uaGdXD8D+xjEnL3WxOTI68+zmr6lZbeKyFrqWrlQCNf2atIeE604iGYKCqM WkxZ+RQBE4r1n8mVmEsx6uXXHYWoxAePvT5titVD8xvjOlX/5F6WBm+xRyy9JUUrzoBy 1UOIT+ayLa8evLgI8uI3ZYhuDM2IZ+YS218mbLlF5DxWZ6lV9gyEeAvfaEvOmTSmsmYy jDggTM8aEeI3WyPDhX0PJmWkpFetK6GZT3I5o7pXBkKvR4Eas+dCIVnj+gdvkHJVxGuD E6g0QIqvfLkxkjxElz8hHZfx+qrk0ZsLbmX9ZKAIVOWSoLozRrHkHnMZWnRGmozaKkhn nA/Q== 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: ALoCoQlymRQFKBljBm+hMt6QrhlEANssPz2I2n2h6u4Z3YlZdMiZ6v07zIBapNKmn25L0UurbpiT 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 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;