From patchwork Mon Nov 26 08:10:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10697751 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 4581217FE for ; Mon, 26 Nov 2018 08:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B6B29779 for ; Mon, 26 Nov 2018 08:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B516297CB; Mon, 26 Nov 2018 08:11:34 +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 C99A329779 for ; Mon, 26 Nov 2018 08:11:33 +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=5xInx0uIQBQ7Dhrnpam15Sm3C67DjZxdgNYthgngaoo=; b=Mj6BzV5elTCwLF T0wr81+QHbTi7QJGADAuAm7X0khRuLBNV/Hr6psz06925Prz2GJRtELq68tSxtyQp7njQKFUDt8RF 7mk5tc45hvSUg1+tXJy7ShHE1Mc3xt/DDlUJSkJvCyezhS3r9fTE0ItoM0ITOLDM0EH5iz8zT10n3 OA1AiO6wv3T6ERAwbofCEeiPpK4nmaYbm1F8yapUprOL9+LlQClKrO47eectLuyEN/Quvormf6NJH bZpyj+zgFyhj5nComstyatwMw7JS9XXMURbAuIGYGwgCvWQoyiRCENiW8Or44sVT8JDf8agSqMgOy G5a5ZCYuBNJ4tyDJ45FA==; 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 1gRBzN-00083p-LK; Mon, 26 Nov 2018 08:11:29 +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 1gRBzK-00083E-N3 for linux-arm-kernel@lists.infradead.org; Mon, 26 Nov 2018 08:11:28 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAQ83XV3104251; Mon, 26 Nov 2018 08:11:04 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=L04w6/G3QJX6fPql7+DbXsoRMVwb87RrsyfwHHjSwSI=; b=EQsbquthI+Mlkg+PIbOEWUrxfwet8QXZo4HUGO2frdxfxEhTYpSFWiTwuSTTCnNMsij/ FcKnoeHXdX0WiW3useSiw8TMkz4cjvIEhg7ybul5ws//BiQRl9Ql7us88ceppw9fF50s hslpI/Qwb22Qf5b7+m23iaRlcyiWVM2s5sIApjHUNDVOhlyr3iGvvPW7BCLp+LrM2VBt CDbTOQsXcdYUc5zf+SEcHwrgEXJOo6anS/5TDpquf+uUJbFoRn1v1w0km3rq8Bvg1JuF KGBEOCcGgJgnmBO0IlnoCWXwX5+CHyCrDFpmgAY43p9f0Z9tM0zW4Z1p7tRJJeCwdzvt UQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nxx2tv5k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Nov 2018 08:11:04 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAQ8AvW4000321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Nov 2018 08:10:57 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAQ8AsN9020714; Mon, 26 Nov 2018 08:10:54 GMT Received: from kili.mountain (/41.202.241.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Nov 2018 00:10:54 -0800 Date: Mon, 26 Nov 2018 11:10:44 +0300 From: Dan Carpenter To: Maxime Ripard , Paul Kocialkowski Subject: [PATCH] media: cedrus: Fix a NULL vs IS_ERR() check Message-ID: <20181126081044.yz5tenssdbt7mugb@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9088 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=916 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811260076 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181126_001126_846527_B68E48C4 X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The devm_ioremap_resource() function doesn't return NULL pointers, it returns error pointers. Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") Signed-off-by: Dan Carpenter Acked-by: Paul Kocialkowski --- drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index 32adbcbe6175..07520a2ce179 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -255,10 +255,10 @@ int cedrus_hw_probe(struct cedrus_dev *dev) res = platform_get_resource(dev->pdev, IORESOURCE_MEM, 0); dev->base = devm_ioremap_resource(dev->dev, res); - if (!dev->base) { + if (IS_ERR(dev->base)) { v4l2_err(&dev->v4l2_dev, "Failed to map registers\n"); - ret = -ENOMEM; + ret = PTR_ERR(dev->base); goto err_sram; }