Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2637734pxa; Mon, 17 Aug 2020 15:07:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp2DKdSh7Uq/+2XtZ2cSd6dPC1FIzkHMs3kA33uWM1zpKlxz1z9gSB6m6Wbh2BCGVzdhbA X-Received: by 2002:a05:6402:b1b:: with SMTP id bm27mr17391811edb.140.1597702079109; Mon, 17 Aug 2020 15:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702079; cv=none; d=google.com; s=arc-20160816; b=i17BLe6FcYmWnKW6JdaJilNiZKPHzXfzS0xf6jDc90Aa9RHogGR8Y6qKeDfYZUX03y 1JVUrCY3M5RigFEL0t7vQW6UljaO7BHSRRrFwII9IDr/0qq60HW3dgia0LUsZHZPNYua vrBVwHcdIntyVyDtpv9RBN6wHyaSDQKDAjblGrVzVEpCtT8Q4Aqc/3yaUcYlSdRZjNrj b74WPTxtkY2+wighNabYSK3vfLgx4Qt9akIGr/vvtninAnWESaPptwrz89WM/IN/4Tp1 s0p99dVauCO7Fg/FKDb35EVa+8L/1+VaHDRDMApbp5tM18VI0hcr5hG6J4ZAFIQLL5fE Lmag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rJWaXTBB21yiPtRTVGHe/TxScUIWovrRpQn/jLR+XBg=; b=c+Yn5J71s6s6zm6FqYpLFlcj5zYhoiOopX8lO9JE9GPvZzBMKYbbThbm4lLWWhqcaD AC1w1c9M586ZwB722LfXpW2UdXQJmVNZ9o5yzTBZx2DR8qWKzqRoBFCv+q8m4vzrvVSV l069ZcEiYUWvzBgGC2xBsSPlx3GSt8BPdgaBUC8hYEbZE11mZfCfjQW8M+S31I6/2CAG qLKyqsXR2LERAZRXOtkJMeGAKFSrm6rdOVEfg6CmmmUwAk+yJBv/f/JvU1oBW7Cnj2S1 wIOyVKTTb13ARSFXtkcrHKuwv6GcvVagOqtqmobn2OykcyUkEdk3Qb0X7G9gQIRUJUsr rGxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l7IVCDzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si11565548edw.527.2020.08.17.15.07.35; Mon, 17 Aug 2020 15:07:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l7IVCDzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731154AbgHQQTW (ORCPT + 99 others); Mon, 17 Aug 2020 12:19:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:33248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387766AbgHQPtJ (ORCPT ); Mon, 17 Aug 2020 11:49:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D9F02075B; Mon, 17 Aug 2020 15:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679348; bh=Be9bnFR/qhCB1VOcb3WJyzG81zm0wVIlrCEePGk53wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7IVCDzOjGuN/xptBaZooYOOywzwBwWqRbiIvnhkWVwmpF1x/nrhY34pSLuRBjNK6 oF/1VMn4KaSiXsw+usIZtzIm/EDTIrfHV2P8YJeqQ0ly9SyxSjZ/5cPR3WXmfEI6Hq a/98Pez0qibm0Dob29TpFeY5+Xt3/ZDehm3Q1Mjo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.7 180/393] media: allegro: Fix some NULL vs IS_ERR() checks in probe Date: Mon, 17 Aug 2020 17:13:50 +0200 Message-Id: <20200817143828.348368828@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit d93d45ab716e4107056be54969c8c70e50a8346d ] The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Fixes: f20387dfd065 ("media: allegro: add Allegro DVT video IP core driver") Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/allegro-dvt/allegro-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c index 70f133a842ddf..3ed66aae741d5 100644 --- a/drivers/staging/media/allegro-dvt/allegro-core.c +++ b/drivers/staging/media/allegro-dvt/allegro-core.c @@ -3065,9 +3065,9 @@ static int allegro_probe(struct platform_device *pdev) return -EINVAL; } regs = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(regs)) { + if (!regs) { dev_err(&pdev->dev, "failed to map registers\n"); - return PTR_ERR(regs); + return -ENOMEM; } dev->regmap = devm_regmap_init_mmio(&pdev->dev, regs, &allegro_regmap_config); @@ -3085,9 +3085,9 @@ static int allegro_probe(struct platform_device *pdev) sram_regs = devm_ioremap(&pdev->dev, sram_res->start, resource_size(sram_res)); - if (IS_ERR(sram_regs)) { + if (!sram_regs) { dev_err(&pdev->dev, "failed to map sram\n"); - return PTR_ERR(sram_regs); + return -ENOMEM; } dev->sram = devm_regmap_init_mmio(&pdev->dev, sram_regs, &allegro_sram_config); -- 2.25.1