Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7107731ybi; Thu, 13 Jun 2019 09:40:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWHcTcJAW8Pk8FiJAIsTznKIdR1pguMzbV8fSdykWNEZX93HAiNfQOh++IYL/YXJs3NRPP X-Received: by 2002:a17:90a:dc86:: with SMTP id j6mr6163543pjv.141.1560444043164; Thu, 13 Jun 2019 09:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560444043; cv=none; d=google.com; s=arc-20160816; b=jc21bvGl/EZSNn51VJeUDTxmBsAUYYTczclK0khj69EmJwwF4KkEP0wktXRSdz1iMg h/K6xOEw79sBCRRsX7k/evPASZgZ+kYhlfi61Gm7MfQFE2UpPq8uE4BiOi9qGwZ24mxr AQq639qsE86ZnEKkw81S8XnuIO4IX1Tb4qxG5K4FkEZm4Zv3KIhnLt7mUiwj9X/AouzI EDIB+Zdu4HQs25FuOCYLyMLGyL3pzfvF5s4hcdJlh/Z4EMXoSnkVrcfX6+7HOG0VE0wR ECcMMJSOaMFK8zK3x5I3QGEduN1gmrDue/n8QcOkeZ5w3jm6RSbDqq0rXp80H20YoOpg jpNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=GWkzr3jkawX0jlNx+2BVZb+IG8NfTmELRDy+IBSm2Yg=; b=l1G7xXXTqdA1ubbstkOuhkeBa8W7rq+drzmPn8ZsDhi5vQyM/WZL308mgzLgm0RPFu yyFcg0DqOTaFCVocC4wojCd7TuJ7dQ4MZbuc7ytTm6+FcMzhBRm2Dvji+uB+eFQz16ik cr5mDINDa5KnA11Ftsw24finttHxlOWYbI5DzIHkq7qfRz4oUabyIX+Kt/3brIEs2ofq 6z6lo4qVz18dgvhn4V11y2rTxfQWl7L+SEw+SvV6xVlbdM9QmpOI9T/UvACqATwc7Kqw yo/kvfrmNrt/BnsPNBPdsB5jJEH1VwFAQ1yPhMujERxsX3reQc259lv9OwVPDkED0YIZ K3Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=qKMfWdTB; 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 k13si79733pll.64.2019.06.13.09.40.28; Thu, 13 Jun 2019 09:40:43 -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=qKMfWdTB; 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 S2392837AbfFMQkP (ORCPT + 99 others); Thu, 13 Jun 2019 12:40:15 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:47408 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730584AbfFMHCT (ORCPT ); Thu, 13 Jun 2019 03:02:19 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D6xg5w034858; Thu, 13 Jun 2019 07:02:13 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; s=corp-2018-07-02; bh=GWkzr3jkawX0jlNx+2BVZb+IG8NfTmELRDy+IBSm2Yg=; b=qKMfWdTBqcBExZ9df8xxGPR6kh7zC1F7ttzJhfJV98th/Vh7U+7vbspfNgXBK7CHxVDA KwcEZwPvA2973aDyk6NA/7Ztc7bIK2qOxUGr1owLoXQQeonDQ9/7mF5PYgcRnQfXI8+6 XMg1L8Ma15aY7mfB+brALCksWH1vIaD2Tp5k9k9yAFEYIbqVxYa5T/mG9PYwV2MVKLQm Rw6U9MU+je4/cTMzk4JgOCurZsQzQHq/CgiBMNoUbGy3imBa2Dpf4Si3sVIyTRqh1GJk mG3cUPGc33fOv6w3IvbT3RXt7m9/2LgFb61jQKDzL7KT5sj7gIX6xEmzNXeJjBRQut0p Ww== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 2t02heysv7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 07:02:13 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D72C0o020953; Thu, 13 Jun 2019 07:02:13 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2t0p9s8b3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 07:02:13 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5D728mi015951; Thu, 13 Jun 2019 07:02:09 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Jun 2019 00:02:08 -0700 Date: Thu, 13 Jun 2019 10:02:01 +0300 From: Dan Carpenter To: Krzysztof Halasa , Linus Walleij Cc: 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: <20190613070201.GH16334@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1906130056 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 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-1906130056 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 --- 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