From patchwork Tue Apr 19 21:04:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 8883411 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 89DD9BF440 for ; Tue, 19 Apr 2016 21:04:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A804F2010C for ; Tue, 19 Apr 2016 21:04:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C61F620211 for ; Tue, 19 Apr 2016 21:04:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933595AbcDSVEb (ORCPT ); Tue, 19 Apr 2016 17:04:31 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38799 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932937AbcDSVEa (ORCPT ); Tue, 19 Apr 2016 17:04:30 -0400 Received: by mail-wm0-f52.google.com with SMTP id u206so50390955wme.1 for ; Tue, 19 Apr 2016 14:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qSqIaFfqqMC5f32oMsusNG9ekqTvplR9G/cAKpvObOk=; b=UJofF7P3m5OCYglZVrB7fzDLxO7HPmD1B10W5EopfbkYXX32D+KIIro9oXhgG8/uzg BPKAs9CsW5QziijgKBEjPeof1stT78LNf0J2U63X/wlkHyelFanvhjPW+30e+e1QuXq9 bmI9zN9guanW4i3XP7UbN2b8cLpCCkW6pG9j3FQI/qLY33LEx+Uj9xIvu+V9rl+z8/Jh WJugohu5071gJ/GgDzu7q3qKRLcZ3IxCa0M1VFBmfw1Wi7x5x1roeNsspuMqIiQYEi18 yg46B1RgfX1lGU76cmT99/e6DmG0jwxqU+oY9yE8hBVMrh6brbtSq6QHKlDzg8gQtwVf 4L/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qSqIaFfqqMC5f32oMsusNG9ekqTvplR9G/cAKpvObOk=; b=Kr7gdSHOcZnw/StIC3bAHdnJfvChafTB194seQp3ajRdO5DiCyLNn064VBn5aOFZqT t6IVwGXAJs1LRb/5orVRbOuktBzvishk4QyR2wCWeJQk5GdpZhHLBw1LEB8fPbPS/HN6 Na0+q7YU6H9NEqGoehzV9HyiwYrRD3xnHewbitWtNFc/JRUzkyqFDxSg5NgPXEoLaMJO sMw29wx91kj3b2Rk6DQcCbWxTquaTHe9tnElTo2zdstMS/YbEQFg3ppTbpw73TWChKQG 2d0t78wO95ilJaQOf2FuccVIRjHAfjI5ur0uL1tqcL5qxGKnPFsuplFyg4/P6nrB8t6t HD+w== X-Gm-Message-State: AOPr4FUMAm5mdwYhS9F3Cvegokq6yzkOSSSTXNZnb1bOemna+fWZNjC/q+VqWhMB8kVxig== X-Received: by 10.28.157.142 with SMTP id g136mr5542745wme.29.1461099868820; Tue, 19 Apr 2016 14:04:28 -0700 (PDT) Received: from localhost (ip-89-176-167-254.net.upcbroadband.cz. [89.176.167.254]) by smtp.gmail.com with ESMTPSA id j8sm2074050wjv.44.2016.04.19.14.04.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Apr 2016 14:04:28 -0700 (PDT) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: Dan Carpenter , Andreas Fenkart Subject: [PATCH v3 1/1] mmc: omap_hsmmc: devm_pinctrl_get returns ERR_PTR upon error Date: Tue, 19 Apr 2016 23:04:13 +0200 Message-Id: <1461099853-15011-2-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1461099853-15011-1-git-send-email-afenkart@gmail.com> References: <1461099853-15011-1-git-send-email-afenkart@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Only the dummy implementation of devm_pinctrl_get returns NULL. The real implementation returns ERR_PTR. By enforcing pinselect in Kconfig we can simplify the test to check only for ERR_PTR. detected/triggered by static code checker. Reported-by: Dan Carpenter Signed-off-by: Andreas Fenkart --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/omap_hsmmc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 1526b8a..b469755 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -366,6 +366,7 @@ config MMC_OMAP config MMC_OMAP_HS tristate "TI OMAP High Speed Multimedia Card Interface support" depends on HAS_DMA + select PINCTRL depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST help This selects the TI OMAP High Speed Multimedia card Interface. diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 62e421a..15ebc3b 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1842,8 +1842,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host) */ if (host->pdata->controller_flags & OMAP_HSMMC_SWAKEUP_MISSING) { struct pinctrl *p = devm_pinctrl_get(host->dev); - if (!p) { - ret = -ENODEV; + if (IS_ERR(p)) { + ret = PTR_ERR(p); goto err_free_irq; } if (IS_ERR(pinctrl_lookup_state(p, PINCTRL_STATE_DEFAULT))) {