Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp117094lqo; Tue, 7 May 2024 14:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvcinKvGqrneNhWJH21tf0jcAj2vSKCh4S3zOoXQ9H/MCQC9kl1WPcJxfvZO90E3YFzn+NHESV47rtP+3Ii7RgmdvUCxdJbUP9AypHnA== X-Google-Smtp-Source: AGHT+IFNsOEKFWmsxe9huAfAV4/dTatwOahS1oWVMLQT6KWAGmp7F0mQknBQ8hnLCrSGzoi/B/wX X-Received: by 2002:a17:90a:940c:b0:2b5:91d1:3ae9 with SMTP id 98e67ed59e1d1-2b6165a4a52mr717080a91.19.1715116198951; Tue, 07 May 2024 14:09:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715116198; cv=pass; d=google.com; s=arc-20160816; b=XFJ64Zu5zcSLPlJ/SB1e+M3En7HMvi60pRLlAxqB2kPKfBV3J0xjeSAAzoig0MnAnh VlrD3D6e7vVl5iQUp/dnZ9x58WY8cnxpKeas0GQvzw4BVwKRfoz++7VdEVLWoqX/jmBz l3lEhSFRaZN8g1szinLO0y+j36bY5lXXGLBqRstieUHY9VNOd5YRcJdzoQ13nsQOcnih uOfGZFTU8CAMuHeyy5URiJJc2/hlTBhMvMkc/yS3tgyQsnI0je0JE/foMPyqjmajLrOA jW/QDRBxtV/AJWRIfnkqKCWtSkdVQmnLqhg3BezxCOlhoIF5bin+1wgAMkU19a7pgToa gAIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7KsCAkZufdnvoKupH4MMr1RjSEEVtbK+rY/J+JY80RQ=; fh=SuIxv82QCyJquXS2CR2IErWvuMVabdCeSXyu+c3Al8g=; b=Eb7K90r4XpGkJ9Xv5DjAdWab+KIDjGyb8Bk9pkEcaqWuWAj+RK60vKluh4CvpcmbuX CL3hovDI6/CL0UlRHFTWU+MQJ49ON9GkRr97zyZzaeEOrPwKoC7TGlCKEFuZvUmUM0aQ BKWzj/DEJ8eEn5g7N2BEH4S87e7VuqQlFGxSee0Zulv5xTUj8xtlkRY/dIgw4Xh7a84y OM/+e1XiphE3kcU4STMvgKX02OgusCT94+/kDB2j+GoLVkobEBioy1QxniAf0mDsumh2 VCPFn1fH6p8SzsILjgs7A9yrEGkzcRBlPB1Ho75xq2jkO5B1r4fl8RF+TBRQev+hXINk uBnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OlV/viAf"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l3-20020a17090a408300b002af49ea6474si8970560pjg.121.2024.05.07.14.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 14:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OlV/viAf"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 05B11283A9C for ; Tue, 7 May 2024 21:09:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A597816EC0B; Tue, 7 May 2024 21:08:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OlV/viAf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBDC415B0E8; Tue, 7 May 2024 21:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715116094; cv=none; b=GhaoQGijNM2e5onMkJ/BHpchCGl5P0nAr0txfG+c1cvx/SE+bK4FWSFhcuEcRA1zZbQXxCtafvAd9sGhWp+hdWyZlG1yzEtzqSaSFAL4d825iW86ofAnn7QWA8os7FwTVuCVtYCNZ6r9GjvhGZYhF4PgVkorv7u47TUNPpY3g+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715116094; c=relaxed/simple; bh=hTYt9yykoNUZnYemRLbUU2aDWH5rmMo3jmzVWlnUb5k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hv9gCbNhFy0ReFZQeOLfoGF/KDMwrwFl8uvF8fHdQH7krDND2s93B5QEPLYwOEoBwqgQLzA1Oo2gkUMPLnwvpo6myuuMQKwmYsiAA1/lFGzknoeEgdGvVYXRqNtei9siXhAcyFZDscuSd+v1p6r1jr4BS3jJQNOkQfUWc/1RIrQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OlV/viAf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2911AC2BBFC; Tue, 7 May 2024 21:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715116093; bh=hTYt9yykoNUZnYemRLbUU2aDWH5rmMo3jmzVWlnUb5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OlV/viAfjXit4fREB+Rt0UAMuTtd4wpBWuZ3xXrD9LC11dIZYvUNSB4G09d/gnt3k Ov3TyqsM4B7G7gLPnlHk9IpMZ4sp3eIr6XCjfYjFMA1f7A/pFma6m32NzR6UFGOHet 2ygGdp1eHfWCI3qN2jiMCaqaFoo/83FWh6N8YbwWnxBRMKp3o7TJeH9d1qFsrNGS2W WMwjy3XlDrhRVyY34U8b4EWMJUgcRT9zhRGwqbX2/0MOcTs2/vu0QLypftyq+b79dC /rN8u5FTOH55ukd2nW8TBdcrwjwJhBg9o43RyyrdLkDr8LC9Z9Tuq4wrAShcigWQ+r mngpoNanHizaQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: Markus Elfring , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Dmitry Baryshkov , David Collins , AngeloGioacchino Del Regno Subject: [PATCH 05/12] spmi: pmic-arb: Replace three IS_ERR() calls by null pointer checks in spmi_pmic_arb_probe() Date: Tue, 7 May 2024 14:07:42 -0700 Message-ID: <20240507210809.3479953-6-sboyd@kernel.org> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240507210809.3479953-1-sboyd@kernel.org> References: <20240507210809.3479953-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Markus Elfring The devm_ioremap() function does not return error pointers. It returns NULL on error. This issue was detected once more also by using the Coccinelle software. Update three checks (and corresponding error codes) for failed function calls accordingly. Fixes: ffdfbafdc4f4 ("spmi: Use devm_spmi_controller_alloc()") Fixes: 231601cd22bd ("spmi: pmic-arb: Add support for PMIC v7") Signed-off-by: Markus Elfring Link: https://lore.kernel.org/r/82a0768e-95b0-4091-bdd1-14c3e893726b@web.de Reviewed-by: Dmitry Baryshkov Reviewed-by: David Collins Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-pmic-arb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 9ed1180fe31f..937c15324513 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -1462,8 +1462,8 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev) */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); core = devm_ioremap(&ctrl->dev, res->start, resource_size(res)); - if (IS_ERR(core)) - return PTR_ERR(core); + if (!core) + return -ENOMEM; pmic_arb->core_size = resource_size(res); @@ -1495,15 +1495,15 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev) "obsrvr"); pmic_arb->rd_base = devm_ioremap(&ctrl->dev, res->start, resource_size(res)); - if (IS_ERR(pmic_arb->rd_base)) - return PTR_ERR(pmic_arb->rd_base); + if (!pmic_arb->rd_base) + return -ENOMEM; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "chnls"); pmic_arb->wr_base = devm_ioremap(&ctrl->dev, res->start, resource_size(res)); - if (IS_ERR(pmic_arb->wr_base)) - return PTR_ERR(pmic_arb->wr_base); + if (!pmic_arb->wr_base) + return -ENOMEM; } pmic_arb->max_periphs = PMIC_ARB_MAX_PERIPHS; -- https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/ https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git