Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3676778ybi; Tue, 18 Jun 2019 04:55:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqVw13l92wzUZT5NcgRI0NNxX2aB2dRkw9ruCI5fs2NeAG58vWTZwnIbEgncdT47z61/Ao X-Received: by 2002:a63:d218:: with SMTP id a24mr2371986pgg.419.1560858905269; Tue, 18 Jun 2019 04:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560858905; cv=none; d=google.com; s=arc-20160816; b=a7O9NI6jNaGpnaCkNWnmxbEVTfvZmr+Gj/56c98j5RZ/QccVBwIMjvk9A9ArGFSuGB cNa6qbKQ51etFGJ5JOLvFTt5q5rbw3OC1z7rTOYseMiVn2Qu6JROAZF/t9/vDVGfa8kM lj6qJUoxlcpGrt/PJOJUcDBPBBnlc+Dc3NLnJ4RRCf5z4qpdT0zViPoWx+WpPGn22f8i xuab5M4iZFOFgd8BZcrymDsqy3ZB4gj9NRbTe9PnU3e5PvawopzxzYtXfEGJkg68eE+x 7PvctdTyl6HCzPCJbj05pAoyrcQgmjaM7bvG88veqLhg369c9ECDcWFXCkEDDLqbaPuW Xpqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=9gsdLFMf2r5ChS58kjStnd5HOdzpIyd2OcNY/w49Mns=; b=Cy2wuzDWvvQekrt18BCtz3OcAxDu3VH1RO/xHxrMCaWi/Z2wnjbk/Pzx59EbMmPCgE qykryuDf0sYDOfYeCtTa87cx1sxfBzm5kGpmHgumg0PhqI+lAG/X2pPIDUmtZ7Z7gusX DGaRzDynfr7vY+nwc89NHnC1mHlUm3TnrcIxs1FHoQPNcKXEWs5iXkaP7JaKUTcaNS7e FXDy8l6KZrCngAwQ/8AKH6J4XMPzN5dWp36dZKdeRwVeDI3h8r594pzG8fgsKyFVjCeP jTP1MIVT3fdA1CJ0ZhtxnCDmfr9wefcquc0AbuIq6RLEH8FtjGdXQfZQvhILLS+qPSmP OE7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=d9gd1o7h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si7514457pfe.204.2019.06.18.04.54.49; Tue, 18 Jun 2019 04:55:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=d9gd1o7h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729785AbfFRLy3 (ORCPT + 99 others); Tue, 18 Jun 2019 07:54:29 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42324 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbfFRLy2 (ORCPT ); Tue, 18 Jun 2019 07:54:28 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5IBmlPb069443; Tue, 18 Jun 2019 11:54:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=9gsdLFMf2r5ChS58kjStnd5HOdzpIyd2OcNY/w49Mns=; b=d9gd1o7hmjUYTxOGP40zHRruXHPYmZtIlcGTGDP394sD2WlPaUrTZOtUVk3LaWPHg2TJ mjMxCZ7gVBlInmpHmAWWmfMbYWUGhlaTXLAZWNF4F+9x18BkHI+3BLnSivxT4ijuvCKB envHXGJqKYpo+Cuwloeu9prnK1h0TDKikLu6WqWAe/U96zUJqpPMBzbjBhDJll+06PV8 hVzqfdWmEJcbakNk09MnyJZ/rkIJT2UpjnQPIFpOQmLilqueJr0pfRt4WDqYWVSlVkIu 7o8Fu/1x93/SNk1MzCJYzjFafVqvf6HXmbRbSmG3chxkR42oyksGPSofzuF9lZvOj+WU yQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2t4rmp3xyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2019 11:54:20 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5IBrYNU137368; Tue, 18 Jun 2019 11:54:20 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2t59gdsdsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2019 11:54:20 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5IBsHW4022840; Tue, 18 Jun 2019 11:54:17 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Jun 2019 04:54:17 -0700 Date: Tue, 18 Jun 2019 14:54:10 +0300 From: Dan Carpenter To: arm@kernel.org Cc: Krzysztof Halasa , Linus Walleij , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Message-ID: <20190618115410.GE18776@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9291 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906180098 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9291 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906180098 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources") Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij --- drivers/soc/ixp4xx/ixp4xx-npe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c index bc10e3194809..ec90b44fa0cd 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -695,8 +695,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev) continue; /* NPE already disabled or not present */ } npe->regs = devm_ioremap_resource(dev, res); - if (!npe->regs) - return -ENOMEM; + if (IS_ERR(npe->regs)) + return PTR_ERR(npe->regs); if (npe_reset(npe)) { dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", -- 2.20.1