From patchwork Sat Jan 14 18:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 642873 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 4458BC46467 for ; Sat, 14 Jan 2023 18:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230193AbjANS5k (ORCPT ); Sat, 14 Jan 2023 13:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjANS5j (ORCPT ); Sat, 14 Jan 2023 13:57:39 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9D3B76D; Sat, 14 Jan 2023 10:57:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=COfo/oBaSIMqiEbzejZ+tc/RTs2C5/+Q+HgjZl4m/5Q=; b=nN5H6ijpvyI0WhD3m22iQZr6W7 +5YKA0DdaE6ip5ViwvmqcWedP7YM+ybK/WyHv0nQK6ZjUCkYboQvvOns5QaYWGUd1OHBU/WiPyfye aTc/WgGTLyhK+k4aaQuHgpCR6M6tx4IloALsQD1OCAIZNq9Wf7+N0ZilJ9XXqF0tXzQtR3Jo4qNM+ h2dOZfRUWC4z3CD/qsVD2sS51uk2tISK0FIrQKfBACQvYLNAqqs/IWsKifhcOevg0nMFCxI/JEhwL dYaC8nmS4z6fVoFVa11/zXhghpQdUIVsT/x1HcKdv9dCeAcP3spn8N5qW/5Pi+vSMTWijnYLZZgKv PmIT69BA==; Received: from [2601:1c2:d80:3110::9307] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGlij-006MF8-7c; Sat, 14 Jan 2023 18:57:37 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Jerome Neanne , Tony Lindgren , linux-omap@vger.kernel.org, Liam Girdwood , Mark Brown Subject: [PATCH v2] regulator: tps65219: use IS_ERR() to detect an error pointer Date: Sat, 14 Jan 2023 10:57:36 -0800 Message-Id: <20230114185736.2076-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- v2: correct Jerome's email address; add Fixes: tag. drivers/regulator/tps65219-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -- a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c --- a/drivers/regulator/tps65219-regulator.c +++ b/drivers/regulator/tps65219-regulator.c @@ -367,7 +367,7 @@ static int tps65219_regulator_probe(stru 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;