From patchwork Wed Mar 6 07:26:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10840503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5432F1515 for ; Wed, 6 Mar 2019 07:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FACA28B89 for ; Wed, 6 Mar 2019 07:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2366328EDB; Wed, 6 Mar 2019 07:27:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BFF1F28B89 for ; Wed, 6 Mar 2019 07:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zjOSpOatlWiJ4jfQaFMQghdjp3VRnyLy2AryYmMdB6w=; b=TOgw0ocK6Schtf 5zqervKyM0YM/1imo30GW0pZeIeam2iH+wkpf/ufqFtFajDjY2Nce8c1Y8h0UI5cDFBIp8MQZN4p6 F/43tjs48Lvt17u1J0tShfzDKcdnsk4DB3h0Xk2fMv+ApzkuX1speXbSJCFbtQlR8UQLj0cAuo981 Qo6LdULord0FEdDL5it8B8eYtoO2wMYMSLghp792S6dzQToX7P4YdKo0s09jQmuCXOTOLY/w9O+Ww q8T8ziozRTd+L2dAUpOAI+C+KnRUgXPpv5trnxB78Sz8Hs3kVCzgYf62AUD0O0Zn5sfSAB9Zb7eAG nt+JFt6IN/njPBu15RVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1Qx9-0005BY-GG; Wed, 06 Mar 2019 07:26:59 +0000 Received: from userp2130.oracle.com ([156.151.31.86]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1Qx6-0005B6-O4 for linux-mediatek@lists.infradead.org; Wed, 06 Mar 2019 07:26:58 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x267NMrW057331; Wed, 6 Mar 2019 07:26:47 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=1rpHDUHA5jJc9X4G0TMuwhlEDcL+vwA8XnYP39g7osg=; b=lx8+gPqKeUtXilDBxr2m8IPftnxjN2LLMWGhP0HI6MvVIPX7oHCIOuoYVVwuH66GrJCI NkBel+ZBE2zvu7an/LAiJPm++hSGNLGFA+o5WbrWB5/46aKzuePQVs/+tmSHJ5jhXL+L u+9uai+GeqUr8ob1SnUTlYc5HJ6IALDwKjJ1x8DdpIso1eab/snFnR/8IvEUqtRSOZeP 16L2jtmmdMOQxg+OgrUqAT7lkkQweJeArUuJaV2jM9CDlkNaisiENvr2oTSiJEeWGMmH YWHiLFjJ6fDxi7lmXQEthADtKP5ZCiXQy02P2JKfQ4z5zxcJgjXSRhzy9N1adweJqkpt qg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qyh8ua1nn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Mar 2019 07:26:47 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x267Qkun004670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Mar 2019 07:26:46 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x267QggI021022; Wed, 6 Mar 2019 07:26:45 GMT Received: from kadam (/41.202.241.15) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Mar 2019 23:26:42 -0800 Date: Wed, 6 Mar 2019 10:26:33 +0300 From: Dan Carpenter To: Felix Fietkau Subject: [PATCH] mt76: Fix an IS_ERR() vs NULL check in mt76_wmac_probe() Message-ID: <20190306072633.GA2625@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9186 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1903060051 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190305_232656_915803_413C20AB X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org, Matthias Brugger , linux-mediatek@lists.infradead.org, Lorenzo Bianconi , Kalle Valo Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The devm_ioremap_resource() function never returns NULL, it returns error pointers. Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Dan Carpenter --- drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c index e13fea80d970..b920be1f5718 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c @@ -23,9 +23,9 @@ mt76_wmac_probe(struct platform_device *pdev) } mem_base = devm_ioremap_resource(&pdev->dev, res); - if (!mem_base) { + if (IS_ERR(mem_base)) { dev_err(&pdev->dev, "Failed to get memory resource\n"); - return -EINVAL; + return PTR_ERR(mem_base); } mdev = mt76_alloc_device(&pdev->dev, sizeof(*dev), &mt7603_ops,