From patchwork Mon Feb 5 19:44:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 197024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1157159dyb; Mon, 5 Feb 2024 13:33:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmeihLvExRX1km+Scs0bJWeCU/TqBQ4eVM8fqwLsKMbxDsEXQYOasbUrPNhGwliQ5YtTsM X-Received: by 2002:a17:90a:688d:b0:290:f5db:c4ad with SMTP id a13-20020a17090a688d00b00290f5dbc4admr701773pjd.46.1707168786405; Mon, 05 Feb 2024 13:33:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707168786; cv=pass; d=google.com; s=arc-20160816; b=F3GDXVS1UECx4uXWOCIGH7kQ4fG4rsEJo2bJUskAmw5EGNB6leJx1DtbXj0FKiWPOe u8JfPN6swzdvNJCQIaqZ6ChLk31KKMfobdGz/nLKmsaQAAeAIQFd1V5s/WJwi37HFqK9 gL0/V6U+Q01ptevg92SklR82PFSGDE55Fe/AkV2gLgX74bnKPH9WqsbJdb6P/nthKjhZ 7cT30JR9FoOiQiorcM2DKjzVBqCDwXJgBnHA/YR0SXqak0Lu+5I/safh1O+FU8UworWa qKrTU+lh2UuDs4AhjE9lXsORngu+5RnvgQywBA8c0mWyYIY1VEj/c15Wbg0GuMVJrA4x vRhA== 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=LFp+SfsuKhmrmWY4jZPnTrC2wZIuEq/mi34VgBID808=; b=jEqRUMe4QxU5y+uZ+dCw3zrPYglVo/f9GZKzmgpwZVmN7l1AAPFgpBfqZkHE6xrUkN AaZZjKmfKopObsITPBuonhBYAXy30O3PlW51f2OVQ7igp8eyY1yH+19MnIRatgyXp5Fu hFjRJA+A5xJ7NslOr+FWyVLC8hJSEv7ZzRrctXQ1sFyfBD/c5bEbcB8ZZgioiBA8zPJF etY0u6m8SdsinLfgXHqO9GSA54rRoMeS8zT59NxH9E4bahxvFPdGXAi6954FqLQrRo7o WYsz/Wyc5XYcnx4WiXuRFSuZybS9g39F63DCc8hUXVF/HJMR1mDTZY5U/CTaDHO124Jl koiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nNOg3AKT; 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-53845-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53845-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCUMs0aW7Gg5pH+BFCPgFmQQ6pObfJA//QxtP9H310u2TWZW4DOpFbrH9uQJ85vaBvVWbvXkxO9bwfO2YMTlhraHa+1H4Q== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j13-20020a17090ae60d00b0028c86e12f01si4999952pjy.41.2024.02.05.13.33.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53845-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=nNOg3AKT; 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-53845-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53845-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 7319328D9D9 for ; Mon, 5 Feb 2024 21:26:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1807473176; Mon, 5 Feb 2024 19:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="nNOg3AKT" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 975C467C7A; Mon, 5 Feb 2024 19:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707162303; cv=none; b=DNxJwj+YCGK9LfDklL4FxXsVyzhQUkRSrYXUezQSfvVtr5xomD2MS7oWf0FI+wAjWyi+jNuad5JernwN4Cmquj2DtTb0XJeCjJBFKCUOPB4yqXbhE1V9DvH4ATvUO2cfsDbvDCJ0DGC0/yi5F2cTsCc2gZTx0tT7UEW/mls3F2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707162303; c=relaxed/simple; bh=ilhrdoWUjxQAw/qNLh+VKGDKCDBwtm1fe8dEPR5edio=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=asiuNODk0XO5QpOnycopyzLHlA2ZkqeeCc+XuKEcqtM/4HYniAE1lAWB4RZ4roXQRYg5JKLrs8lOj7gld1lzDc90giNp486u5bReoz1kspHMGFIUSkDULJyAb8d6+sMBi8fFcGoM10pdoNFwElHKctubQzvBHECaL9htm4MKI5c= 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=nNOg3AKT; arc=none smtp.client-ip=198.47.19.141 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 lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 415Jifbd010933; Mon, 5 Feb 2024 13:44:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707162281; bh=DM5F+CDTYAkATD9JuxoEYM5J5TLXMlR0cMppKdmlkcg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=nNOg3AKTGbEdbI5tdXnyfF9whOL/RRDOnTnD/qwzXM9FlJ5O9b3bY/eavQBwwQEXm TZdYMGu3A4sTcZ3GapMSfSW5bKTMjXjmrqPWrQbUe8DetR16CO/XE4Jc+eBrskw+E9 3JcqNMjCrdXtDqC5fWUV/m1g3jb5lnPxxlOJyoRI= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 415JifXm003438 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Feb 2024 13:44:41 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 5 Feb 2024 13:44:40 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE107.ent.ti.com (157.170.170.37) 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; Mon, 5 Feb 2024 13:44:41 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 415JicQQ028467; Mon, 5 Feb 2024 13:44:40 -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 v2 03/19] power: reset: xgene-reboot: Use devm_platform_ioremap_resource() helper Date: Mon, 5 Feb 2024 13:44:21 -0600 Message-ID: <20240205194437.180802-4-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205194437.180802-1-afd@ti.com> References: <20240205194437.180802-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: 1790096216973819356 X-GMAIL-MSGID: 1790096216973819356 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; }