From patchwork Thu Jul 10 06:25:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 33378 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 165D1208CF for ; Thu, 10 Jul 2014 06:26:41 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id t59sf33867467yho.10 for ; Wed, 09 Jul 2014 23:26:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ruuFLQULEl9UXJIePtEOIYZM/W+91IgWUnkg/pPH4i4=; b=aZ5E5eH2JX0l7JFqvpgv9+OLAwA5iDkWc9jOJ8leiVaHC7LI71oSiHtqYZqy3YEemb /xxeHhNm5o0otKXLk+feQnXq9EL6CGvORNeC9fPonjNtXlCg/PWOSlcnyStnCJv/j8IT 4SG71GwA8rF/prV/DlZMXNOOyB3EcnjWC71BIJCPDWgy5UENAL8G40nQMxITAFmI1Jm4 L2ULGsAtr0oO1+3iejBJvORR+llqHj1UkxM3LRVHXyjiDX8rpNzIVoZvYRaj+42TV1KF NStWC6bE3B8myTLHhuwtvkOXsgXMSlXn+YElqVkT8UhlYJEI6x1TYR+t3RSSR7P5URzQ YO+A== X-Gm-Message-State: ALoCoQlmBuaCsH1D1QQuhrgy64IExWHORNGBRmiGkQamaZXxJIQXS1Lo6yTnazFv8Mq+i04RDy+j X-Received: by 10.236.168.101 with SMTP id j65mr1059375yhl.30.1404973600884; Wed, 09 Jul 2014 23:26:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.198 with SMTP id h64ls2869931qgf.66.gmail; Wed, 09 Jul 2014 23:26:40 -0700 (PDT) X-Received: by 10.58.207.84 with SMTP id lu20mr344590vec.9.1404973600773; Wed, 09 Jul 2014 23:26:40 -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 j18si20998650vdf.99.2014.07.09.23.26.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 23:26:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id la4so9833189vcb.28 for ; Wed, 09 Jul 2014 23:26:40 -0700 (PDT) X-Received: by 10.52.117.209 with SMTP id kg17mr36720479vdb.28.1404973600698; Wed, 09 Jul 2014 23:26:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp108044vcb; Wed, 9 Jul 2014 23:26:40 -0700 (PDT) X-Received: by 10.70.35.143 with SMTP id h15mr15196517pdj.5.1404973599749; Wed, 09 Jul 2014 23:26:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ko7si47763308pab.160.2014.07.09.23.26.39; Wed, 09 Jul 2014 23:26:39 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbaGJG0b (ORCPT + 28 others); Thu, 10 Jul 2014 02:26:31 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:38434 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbaGJGZY (ORCPT ); Thu, 10 Jul 2014 02:25:24 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6A6PNKS027941; Thu, 10 Jul 2014 01:25:23 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6A6PNUK003477; Thu, 10 Jul 2014 01:25:23 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 10 Jul 2014 01:25:23 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6A6PIrW010573; Thu, 10 Jul 2014 01:25:22 -0500 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 2/5] phy: omap-usb2: fix devm_ioremap_resource error detection code Date: Thu, 10 Jul 2014 11:55:00 +0530 Message-ID: <1404973503-3310-3-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404973503-3310-1-git-send-email-kishon@ti.com> References: <1404973503-3310-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kishon@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Himangi Saraogi devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. A simplified version of the semantic match that finds this problem is as follows: // @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-omap-usb2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 7007c11..2063d54 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -233,8 +233,8 @@ static int omap_usb2_probe(struct platform_device *pdev) if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { res = platform_get_resource(pdev, IORESOURCE_MEM, 0); phy->phy_base = devm_ioremap_resource(&pdev->dev, res); - if (!phy->phy_base) - return -ENOMEM; + if (IS_ERR(phy->phy_base)) + return PTR_ERR(phy->phy_base); phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; }