From patchwork Tue Feb 20 09:02:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 203501 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp281168dyc; Tue, 20 Feb 2024 01:20:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUiw1KdOFbia4B9QfvOnBm96+lxgNEF/GygLExK+ZlUjGt/SIWnjgkyhZRyvvVBk4gYZk5ch4CgDPzmfkVt8I9hWZ+qqg== X-Google-Smtp-Source: AGHT+IGFrU9HI6LZmacV9byGmg/p0VhJlUAQCk7zfukl1dsx+8GYNy6liqqomF+Q+095jKI0DBIA X-Received: by 2002:a05:6a21:1690:b0:1a0:5841:669d with SMTP id np16-20020a056a21169000b001a05841669dmr16211223pzb.39.1708420808698; Tue, 20 Feb 2024 01:20:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708420808; cv=pass; d=google.com; s=arc-20160816; b=DzJclga9rxa9z7ie3d8lYJU53FOXe5KMhwGRkNVPMmsZzbReK2aXHoCo2YkTuKuCiX CBPe//TdkB8jXOOL7gK1MiBab1zNohLEkpyXt5xsrJ5hA6ETTZdXzT3n0hOWpibi7ZV6 ejNs1DFx5bGQ2mBH46ygPufGhZhrEZUApmcmWiGTIJJWgd3pPfeFv5FWttCKTHa43L0A UGLkpfR72eAUclGBgkuYFltWoIUsHx/A8JVUfcXJzOe+3viOzNChOjGl9sqacrWN6cME 207gXxxcIs0ar2AptyePQfEiiL3wtj9IEEc91AgkleNWl+K+qK86aj8gPny0htiHyFve JYJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=GySeikmcOETTtUkW23ZAy9xSze7pMX1co+DBAoFFtok=; fh=HYnD+LzinQW4zuqkhMYtk7XVJHvQsm6rwK1WQGhsCvI=; b=OIVBmM1aL0Vmmvf/n6VUo4VzuJhgZNFW7jT84/l1srFqGnM9Gqdvu4al5lR+s4UZrI 9AWbEVOQpGBsLnzMR37X84YDTfuyBiDhRpb0dxAimdSpumogCOmhh7sJ9Hi+dUzmUQ39 pf4XStH5Btfb6zNV1uX1Z4nRSfNH/5sUu9qKs89Wue2Mc6d5uhpUeWBArfzSP+IAafnj JiYemM8iG0I+tEwkoKxxrPIh5yms2ONZJbfBgIcyLS6pM7B1e+mX+wGvaN/x4sq48NkT OaSlinVSarfRgJHNjzIvdviQo3P+0QZ+B/sIgHkYBNv5YDB8tyIJF6iqJe0owG3NLGy1 IWjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L++1ZMrc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72637-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k16-20020a170902ce1000b001dc1284bc01si1181222plg.326.2024.02.20.01.20.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:20:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L++1ZMrc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72637-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72637-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2D995B26F57 for ; Tue, 20 Feb 2024 09:04:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94606612FE; Tue, 20 Feb 2024 09:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L++1ZMrc" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A1DD5D48B for ; Tue, 20 Feb 2024 09:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419751; cv=none; b=m6RTR6TD4L+erTeYsyJ4Fphd4qP5VzlTdjrM44R7Fv2OSNhQceVGSXlbMNV8rIwmsIGgQCItl7CewdsMjrwgCqq1OFjsuoxb5hxlPk5QiIfPZand4y+7x5LXB5dd9OaUd72CcvQ6j9oHOYnMxsVVouHYkoFOwalKXAv33Q+Mr7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419751; c=relaxed/simple; bh=KkdvrdrLCm8OQrPK+czFlLaYo1JrtJ3rNvWITsPyWBI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=BxFdRJydnxYGff/+SfvrJ9OGKQKxzPsb44p+d4lrehJdnS96OUBNr77x6fBTBxqHaOHyY4BJq1m0iP5Y3notCFSSNZY9Vr0XlNiF32kvDjIg5Riw1Dqx7S+uC5f0kvEFZB+piX2gL8zyt60/IS/MQZWt82PUXKO+DkVzNld0cBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=L++1ZMrc; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-564d780d55fso196805a12.3 for ; Tue, 20 Feb 2024 01:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708419747; x=1709024547; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=GySeikmcOETTtUkW23ZAy9xSze7pMX1co+DBAoFFtok=; b=L++1ZMrcA87+UCoRJwNqCkJS7F7NjPmFQG4LOmyo8au3KzMhVERSaypbb1x/ycszjU Y1Set/ojJWLeEbT7cW+MzEyvt2hWL4BW3b1RELOXZykZKcU2TY0CzsGzwnumjofquvgU LROp3az+8alvECAWpT3ADV19lapVSbGPwKaoRVwFW7dSnxOJH+RcD+fGMPpF4ckhDq7k ehjqGKaygEMJwfNw/4g8bdS5ANgdCRSqS4mAT7lMMaVHL2m1FQyNxQxK0SPH4hQRS1Gc w8XbzHEQcDaGPGIsp6/nA44jFi/5N5Rq4tC7Zcd7IXuxbsn+rY7HKp++AGx39pyXpTR6 DPPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419747; x=1709024547; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GySeikmcOETTtUkW23ZAy9xSze7pMX1co+DBAoFFtok=; b=a6dy264GumI+y2mh+7e9lx2NmLmX2dDClK8LIIpt9S+oAtdCYUCmpXPRa6a/cwcbmO UB5b4SxPIhwC2HQakFo2CLfcis5TUv+cx5yOjW2gVw4GCB2jQmy9WmCgupF5fDqjK0dk 7M7HgcsRYwmNXKVJ0u96/2CKEZNpKKktuc2vb1kvv1zk/g8D0BLkbbZyMijyttsfzlsD EjeyUVeySxuxM/8hVdEEsG7sYj+XEfmT1dW8UiKRt/A0qFCONCySXEJIHbFqAdgm+pV1 Fp1+T4Pv6w1F9bSVmjfICNwrYdVMFl1nSJlTG5YQdpDZPHxqGzOyZLum0DUGDP3arXq8 sHEw== X-Forwarded-Encrypted: i=1; AJvYcCVOzO1kLnE/yW8V0jtuPuUzwZW0ld4JuXt4n+Cl4T6WFrpTTR+bRBtuRD662yQ/ApyhQgGFmatV+WMDZG0guhVQC7lyxKPLvLASeGFu X-Gm-Message-State: AOJu0YwGhcPoPTeQgvtHaUcwrAIFnFYs1VAoGzJ51iF/+n3AjApODJu+ zmeOr5tfdAdoGLiok30nw7B5E7k5i0LxThfRzTv9xINpujdL21GtaH5U51d/kig= X-Received: by 2002:a17:906:594b:b0:a3e:9df6:7f0a with SMTP id g11-20020a170906594b00b00a3e9df67f0amr3294880ejr.68.1708419746720; Tue, 20 Feb 2024 01:02:26 -0800 (PST) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id wb8-20020a170907d50800b00a3e9c4fa24esm1757200ejc.96.2024.02.20.01.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:02:26 -0800 (PST) Date: Tue, 20 Feb 2024 12:02:22 +0300 From: Dan Carpenter To: Andrew Davis Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791409057484873934 X-GMAIL-MSGID: 1791409057484873934 The devm_platform_ioremap_resource() function returns error points. It never returns NULL. Update the check accordingly. Fixes: 7ddfd33c6ee5 ("power: reset: xgene-reboot: Use devm_platform_ioremap_resource() helper") Signed-off-by: Dan Carpenter Acked-by: Andrew Davis --- drivers/power/reset/xgene-reboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c index 867162dfe7ea..b5eee19bac42 100644 --- a/drivers/power/reset/xgene-reboot.c +++ b/drivers/power/reset/xgene-reboot.c @@ -51,9 +51,9 @@ static int xgene_reboot_probe(struct platform_device *pdev) return -ENOMEM; ctx->csr = devm_platform_ioremap_resource(pdev, 0); - if (!ctx->csr) { + if (IS_ERR(ctx->csr)) { dev_err(dev, "can not map resource\n"); - return -ENODEV; + return PTR_ERR(ctx->csr); } if (of_property_read_u32(dev->of_node, "mask", &ctx->mask))