From patchwork Tue Mar 7 16:53:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 13164427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A35A5C678DB for ; Tue, 7 Mar 2023 18:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbjCGSTj (ORCPT ); Tue, 7 Mar 2023 13:19:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbjCGSTQ (ORCPT ); Tue, 7 Mar 2023 13:19:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABA9D98EB7; Tue, 7 Mar 2023 10:13:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 56C4DB819BF; Tue, 7 Mar 2023 18:13:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA12CC433D2; Tue, 7 Mar 2023 18:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678212814; bh=n+sYdglaMEvderyK4mj/+bor45xNcgO8npFFKiV++ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o92XsrYbWGp2rYglpfqoOPmwa9OagKCbrWRhQ/e3GBP+Os2MGqG83k9e8yoj32dfu DYdCfGtvvkHiK9rN22X7V4W1JJV62w5KivVeROf+zd63nN3nxMwCVKB0HzYfAJiJbv YHtmbZ8KnENKcuvRt/dD5Ovz4O9z3mQNoKbTh+g8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Randy Dunlap , Jerome Neanne , Tony Lindgren , linux-omap@vger.kernel.org, Liam Girdwood , Mark Brown , Sasha Levin Subject: [PATCH 6.1 304/885] regulator: tps65219: use IS_ERR() to detect an error pointer Date: Tue, 7 Mar 2023 17:53:58 +0100 Message-Id: <20230307170015.308350237@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Randy Dunlap [ Upstream commit 2bbba115c3c9a647bcb3201b014fcc3728fe75c8 ] Fix pointer comparison to integer warning from gcc & sparse: GCC: ../drivers/regulator/tps65219-regulator.c:370:26: warning: ordered comparison of pointer with integer zero [-Wextra] 370 | if (rdev < 0) { | ^ sparse warning: drivers/regulator/tps65219-regulator.c:370:26: sparse: error: incompatible types for operation (<): drivers/regulator/tps65219-regulator.c:370:26: sparse: struct regulator_dev *[assigned] rdev drivers/regulator/tps65219-regulator.c:370:26: sparse: int Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Signed-off-by: Randy Dunlap Cc: Jerome Neanne Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Cc: Liam Girdwood Cc: Mark Brown Link: https://lore.kernel.org/r/20230114185736.2076-1-rdunlap@infradead.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/tps65219-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c index c484c943e4675..070159cb5f094 100644 --- a/drivers/regulator/tps65219-regulator.c +++ b/drivers/regulator/tps65219-regulator.c @@ -367,7 +367,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev) irq_data[i].type = irq_type; tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev); - if (rdev < 0) { + if (IS_ERR(rdev)) { dev_err(tps->dev, "Failed to get rdev for %s\n", irq_type->regulator_name); return -EINVAL;