From patchwork Thu Feb 8 17:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp317939dyd; Thu, 8 Feb 2024 09:12:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfBaRFsb2HpFLf18oSATt4bfMuQOE0PU1Fk1Thzl8qg3WL+4qFTLogk9IN9feu/dFuF4nu X-Received: by 2002:a05:6a20:e123:b0:19e:3136:1727 with SMTP id kr35-20020a056a20e12300b0019e31361727mr189002pzb.53.1707412357683; Thu, 08 Feb 2024 09:12:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707412357; cv=pass; d=google.com; s=arc-20160816; b=e3DYuEp2jBojY4mpwWuY8f6X+cuv4E1oZTgzH0ccLh6pWrmoLIJ3gGmlG9EEpJc1EG zhW+6lM5OBwbjqse+BJyJpMsJu6SOnzPHPC95ArmmYPe/0QS/pRrbc3g8YQQgIU9JNBp UAMdZ21gb7M3SD3HdFTqncZUejheKBTUnEUDa3qKEiuh0lEGriSVP1akOMmFT8j+x/L/ aaMLAutHqU2ccJ0V7OHX9YWZ6msBUG9Q/AyJwo00sYrfgoP0tquf8UYdn/W/d1rvySxn 11mfLGgBA7lKO9tHG07ZJXGMYDA5ezKxSpfv882zNRRN+w1NFriARcAoz9iNcqnMT7eU L7pw== 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=DM5F+CDTYAkATD9JuxoEYM5J5TLXMlR0cMppKdmlkcg=; fh=4TexMWQlJQM94JjGMjFRtRAyzG7B882tVT8L1Jqu9hM=; b=hMil+qUL6xnrOBKQvofnayl4WP0raR5lEvpisGT4w2lVnwqwkMV2ApxlEY8L2WZiek SiNevQIdZii03y0S+zeI4fHLLBvjw7NZmmHCByrRRG9AmAUBTTC0mi2+MAfbNqi463xu WE21KA30WVWdXyShq8YoV56LNjpINJBqetqUCWx6OSKxfsRO+Y7RtgCAIzDoGe08O91V 3EK26vovp7Ma6rxEKm64RJ4DP4q6ODyiHyYTP0OlyIhkoqYM+bwx3GoAq8XCKkckk4GA JnSx1Dp/cNtMCE8e9dNSiDBQz1m471S5LJY85P/xjmbiFCIULYb2lBU/jltLqTnhdQi/ /1WQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GUXPeyO+; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58410-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58410-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCWH5QFKc7ZLu2DpgcbAvC58vkVWd1o6Rd3bjL5d20kn9L+pB2bADr6FwtmsZKEiDJdzD0JxZkRuQRicDSPAQ4kKJyWCDQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id kb13-20020a17090ae7cd00b00296fa0a582fsi1852021pjb.35.2024.02.08.09.12.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:12:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58410-ouuuleilei=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=@ti.com header.s=ti-com-17Q1 header.b=GUXPeyO+; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58410-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58410-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 2CE96287158 for ; Thu, 8 Feb 2024 17:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBC2612F38F; Thu, 8 Feb 2024 17:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="GUXPeyO+" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 DF7D082D93; Thu, 8 Feb 2024 17:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411879; cv=none; b=iPiQrUe2oQW9ntibEdeNUlhO2UalA17O/P47G6u/zlEQ9TFPLXwFFJrGzpRo00B8F6kfF/EhOzsWTGTAUbjvnQ1sWyAEp1HQRi4WDy1JB2s2vAFYNMAOMDfp55PMCh+GRkiB5kRUwhbA9daZHkW8lNMWoq8zyRS/fvGwbM57tN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411879; c=relaxed/simple; bh=ilhrdoWUjxQAw/qNLh+VKGDKCDBwtm1fe8dEPR5edio=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mcv9LVDCAicd9ceFZHjyp4KvCH2gZ7e49zA2ApLeRXmyRuKMD2m3aKuZAsRj7CYe/e80ER50rnq7V1J//GitD0z1UZtpxljXEHh+TrqF6eecIX/pxKa8npYGENJhYjv7FqMxIMYEjR/tcZ/L7t2W1SC/FBmO+AbqXdVgIbgYTmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=GUXPeyO+; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418H4ELp051751; Thu, 8 Feb 2024 11:04:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411854; bh=DM5F+CDTYAkATD9JuxoEYM5J5TLXMlR0cMppKdmlkcg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GUXPeyO+bMgIyzoRA4DNuzMmb2GvYNBZkAtVpx9T6Eo5ZhXpQt3jT8JkCdjdrVojD BjMsS5vMKERPMJPrP4XyhT9J4xg8LaZtxFmzYMc9xVg3ZM1bl+/++udSoVVXYqrinI Q1ApFsATvr3VJzKuaqd3wQMjOeisG0EVNXXyoCTs= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418H4ErV042386 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 11:04:14 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 11:04:14 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 11:04:14 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418H4B65091006; Thu, 8 Feb 2024 11:04:13 -0600 From: Andrew Davis To: Sebastian Reichel , Manivannan Sadhasivam , Cristian Ciocaltea , Florian Fainelli , Ray Jui , Scott Branden , Bjorn Andersson , Konrad Dybcio , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , , Andrew Davis Subject: [PATCH v3 03/19] power: reset: xgene-reboot: Use devm_platform_ioremap_resource() helper Date: Thu, 8 Feb 2024 11:03:54 -0600 Message-ID: <20240208170410.67975-4-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208170410.67975-1-afd@ti.com> References: <20240208170410.67975-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790351620400268509 X-GMAIL-MSGID: 1790351620400268509 Use device life-cycle managed ioremap function to simplify probe and exit paths. While here add __iomem to the returned pointer to fix a sparse warning. Signed-off-by: Andrew Davis --- drivers/power/reset/xgene-reboot.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c index c2e5a99940d37..6b545a83d8889 100644 --- a/drivers/power/reset/xgene-reboot.c +++ b/drivers/power/reset/xgene-reboot.c @@ -22,7 +22,7 @@ struct xgene_reboot_context { struct device *dev; - void *csr; + void __iomem *csr; u32 mask; struct notifier_block restart_handler; }; @@ -54,7 +54,7 @@ static int xgene_reboot_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->csr = of_iomap(dev->of_node, 0); + ctx->csr = devm_platform_ioremap_resource(pdev, 0); if (!ctx->csr) { dev_err(dev, "can not map resource\n"); return -ENODEV; @@ -67,10 +67,8 @@ static int xgene_reboot_probe(struct platform_device *pdev) ctx->restart_handler.notifier_call = xgene_restart_handler; ctx->restart_handler.priority = 128; err = register_restart_handler(&ctx->restart_handler); - if (err) { - iounmap(ctx->csr); + if (err) dev_err(dev, "cannot register restart handler (err=%d)\n", err); - } return err; }