Message ID | 20240208170410.67975-14-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-58412-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp315282dyd; Thu, 8 Feb 2024 09:09:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0C3ZTzdxg4ge1Knxctsb1xNhg3RXsZjETfjAzyURWdfF2e+8vjjJL5pCmzF/iSQpUMDPp X-Received: by 2002:a17:906:2b16:b0:a3b:adff:85d9 with SMTP id a22-20020a1709062b1600b00a3badff85d9mr1621424ejg.15.1707412144651; Thu, 08 Feb 2024 09:09:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707412144; cv=pass; d=google.com; s=arc-20160816; b=qMgwvgPvxbwRcogdtTKkR/hZLuYqCnVhQvKa2tBQTZABs0JfC9jafBOzuQLqb4Av4X 8mVsJ0ZYvaGUoCe5dlr3hQ7TIdHgOgRM1veUZ3kG0IV1G22aLgg6tYkXaJ29KgGP5uIs JUYBPxoAQN+N+hy+pIZrs8LUpiV5DACMczU1sXwDAGanQt6vueK2Vs6IN+ZqNeHzJfiT rmtNZMvhK0u3VMglxaxVoNmfk7jeWvqLxb254oPnoXXah9YZbuvOBGSixgv/iiVg0xPP SJWRaGwc5qbN2icb6D3yZ39Kxn5EySeQfm/bNuPBcMrbdjDcN198W9b+8KU4olQDtSZk zcow== 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=5a2BDxvry/mDEJhidMjtTRkucrmFZYMP54rfoZVMxFg=; fh=/vewmZFMJ1oLPXCNe4Nmmb4quR/W2asUjfG026+s3yo=; b=iwoOKfVhvT34EL/+aqN5R/m3TRW28epbvTYpdNM+7cZanzOv7/y6X2dudGW1QRGL5u voN8es5aaMl3yboOevOGQz1dSbxR4aMWYWJXvpPs4VOhDDAB2vAeyvBosPmKx8URt4WN bujPRHkXX1daCN9FYDpO3l2KZbNbnbQpvlMgeDi1JywCyNH/ornGnZTm6vGPTF/X4Hoi MRrQQD7HMwqbNjOdwU0nXuMV4HjJZhFj9ZNmgNl5UEhv8bkuuDTkkAJG+3H4gH9GufLm FlzAx5seFLoHDLOwL7l642Ebg6sNPrKQ/TrAh/PLNYlik59gwBIBPilUEiCyn23aqVHW bk6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Nn2d1Jqb; 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-58412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58412-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCUrdmClgqqPP4YLzxdku19uqm/EIjQkxND2rMWPR2+ySYGO/1SnEQ5P9RZl2KPIXUjZzTngjncRZN/HxGHV1pY8JVpwFQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o21-20020a170906359500b00a383a6754d1si218747ejb.509.2024.02.08.09.09.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:09:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Nn2d1Jqb; 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-58412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58412-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 466401F290F0 for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 17:09:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AE91130AE2; Thu, 8 Feb 2024 17:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Nn2d1Jqb" 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 DF77682D61; 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=XQWaqbP3ugVCiNSgfh+HTrABlUrhe9mzUvgjd3kvfUvfac9la/hoQ8IrgwFurHu7BDUq9jAW/0deYmEB3Ve5WGro6yZ6OKi+lGOPaxVY0goE9Q/vOTDMhGBUG7haDS9yhZSVU0wtDZhHNupHNtz5xTTsg8X6LFdKmLhJ7Ipu5Ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411879; c=relaxed/simple; bh=TcZggvWPAiMNrDjTaYr88pR3WYNyYJDkk6qpMPNTC3Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T3IY1w2mWIwORxnet9uPtV0R9awDzekdCEVQjcO7N2ZHAlw0D21s1NhEyApMEbhqeTp829rkE/S5rWNcBXSf7iCfuBc9AC297A2lPPh3UscMD15YJpGcq93WTacQTGIYceJBmQITaSr4j0jnNViLzDG4w0cEIyqhBcvTtHWirKs= 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=Nn2d1Jqb; 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 fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418H4LT3051777; Thu, 8 Feb 2024 11:04:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411861; bh=5a2BDxvry/mDEJhidMjtTRkucrmFZYMP54rfoZVMxFg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Nn2d1JqbkmwolD9eOlmJ4M35dV5MKx16BW64juGbDGBzox+jz/3tFBGxnbgSTI347 WzBCV+ccNDq6AEUwDc7dEVy4iSHkctSWeMUawVFVF9IY7mV0pbUC8fiO8ClwkzgS5p Ita4IL7d/SmY/SbNqKgzvrfL89P0JKhNlCuE7gF8= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418H4L8M054137 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 11:04:21 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE114.ent.ti.com (10.64.6.35) 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:20 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE113.ent.ti.com (10.64.6.34) 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:20 -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 418H4B6F091006; Thu, 8 Feb 2024 11:04:20 -0600 From: Andrew Davis <afd@ti.com> To: Sebastian Reichel <sre@kernel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Cristian Ciocaltea <cristian.ciocaltea@gmail.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Sean Wang <sean.wang@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> CC: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-actions@lists.infradead.org>, <linux-arm-msm@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, Andrew Davis <afd@ti.com> Subject: [PATCH v3 13/19] power: reset: msm-poweroff: Use devm_register_sys_off_handler(RESTART) Date: Thu, 8 Feb 2024 11:04:04 -0600 Message-ID: <20240208170410.67975-14-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790351396496844212 X-GMAIL-MSGID: 1790351396496844212 |
Series |
Remove pm_power_off use in drivers/power/reset
|
|
Commit Message
Andrew Davis
Feb. 8, 2024, 5:04 p.m. UTC
Use device life-cycle managed register function to simplify probe.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/power/reset/msm-poweroff.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
Comments
Hi Andrew, kernel test robot noticed the following build warnings: [auto build test WARNING on sre-power-supply/for-next] [also build test WARNING on mani-mhi/mhi-next soc/for-next linus/master v6.8-rc4 next-20240209] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-reset-atc260x-poweroff-Use-devm_register_sys_off_handler-RESTART/20240209-011655 base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next patch link: https://lore.kernel.org/r/20240208170410.67975-14-afd%40ti.com patch subject: [PATCH v3 13/19] power: reset: msm-poweroff: Use devm_register_sys_off_handler(RESTART) :::::: branch date: 4 days ago :::::: commit date: 4 days ago config: arm64-randconfig-r131-20240211 (https://download.01.org/0day-ci/archive/20240212/202402121342.7WgNqBu9-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240212/202402121342.7WgNqBu9-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/r/202402121342.7WgNqBu9-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/power/reset/msm-poweroff.c:18:41: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *msm_ps_hold @@ got void *cb_data @@ drivers/power/reset/msm-poweroff.c:18:41: sparse: expected void [noderef] __iomem *msm_ps_hold drivers/power/reset/msm-poweroff.c:18:41: sparse: got void *cb_data >> drivers/power/reset/msm-poweroff.c:33:61: sparse: sparse: incorrect type in argument 5 (different address spaces) @@ expected void *cb_data @@ got void [noderef] __iomem *msm_ps_hold @@ drivers/power/reset/msm-poweroff.c:33:61: sparse: expected void *cb_data drivers/power/reset/msm-poweroff.c:33:61: sparse: got void [noderef] __iomem *msm_ps_hold drivers/power/reset/msm-poweroff.c:37:39: sparse: sparse: incorrect type in argument 5 (different address spaces) @@ expected void *cb_data @@ got void [noderef] __iomem *msm_ps_hold @@ drivers/power/reset/msm-poweroff.c:37:39: sparse: expected void *cb_data drivers/power/reset/msm-poweroff.c:37:39: sparse: got void [noderef] __iomem *msm_ps_hold vim +18 drivers/power/reset/msm-poweroff.c 78be3176c4335b Abhimanyu Kapur 2013-07-30 15 bc460fab0b719d Andrew Davis 2024-02-08 16 static int do_msm_poweroff(struct sys_off_data *data) 78be3176c4335b Abhimanyu Kapur 2013-07-30 17 { bc460fab0b719d Andrew Davis 2024-02-08 @18 void __iomem *msm_ps_hold = data->cb_data; bc460fab0b719d Andrew Davis 2024-02-08 19 78be3176c4335b Abhimanyu Kapur 2013-07-30 20 writel(0, msm_ps_hold); 78be3176c4335b Abhimanyu Kapur 2013-07-30 21 mdelay(10000); 18a702e0de9879 Pramod Gurav 2014-09-25 22 18a702e0de9879 Pramod Gurav 2014-09-25 23 return NOTIFY_DONE; 78be3176c4335b Abhimanyu Kapur 2013-07-30 24 } 78be3176c4335b Abhimanyu Kapur 2013-07-30 25 78be3176c4335b Abhimanyu Kapur 2013-07-30 26 static int msm_restart_probe(struct platform_device *pdev) 78be3176c4335b Abhimanyu Kapur 2013-07-30 27 { bc460fab0b719d Andrew Davis 2024-02-08 28 void __iomem *msm_ps_hold = devm_platform_ioremap_resource(pdev, 0); 78be3176c4335b Abhimanyu Kapur 2013-07-30 29 if (IS_ERR(msm_ps_hold)) 78be3176c4335b Abhimanyu Kapur 2013-07-30 30 return PTR_ERR(msm_ps_hold); 78be3176c4335b Abhimanyu Kapur 2013-07-30 31 bc460fab0b719d Andrew Davis 2024-02-08 32 devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, bc460fab0b719d Andrew Davis 2024-02-08 @33 128, do_msm_poweroff, msm_ps_hold); 18a702e0de9879 Pramod Gurav 2014-09-25 34 521ef776c49589 Andrew Davis 2024-02-08 35 devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF, 521ef776c49589 Andrew Davis 2024-02-08 36 SYS_OFF_PRIO_DEFAULT, do_msm_poweroff, 521ef776c49589 Andrew Davis 2024-02-08 37 msm_ps_hold); 18a702e0de9879 Pramod Gurav 2014-09-25 38 78be3176c4335b Abhimanyu Kapur 2013-07-30 39 return 0; 78be3176c4335b Abhimanyu Kapur 2013-07-30 40 } 78be3176c4335b Abhimanyu Kapur 2013-07-30 41
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c index bcf04491e7022..c5831c46f69e2 100644 --- a/drivers/power/reset/msm-poweroff.c +++ b/drivers/power/reset/msm-poweroff.c @@ -13,35 +13,24 @@ #include <linux/reboot.h> #include <linux/pm.h> -static void __iomem *msm_ps_hold; -static int deassert_pshold(struct notifier_block *nb, unsigned long action, - void *data) +static int do_msm_poweroff(struct sys_off_data *data) { + void __iomem *msm_ps_hold = data->cb_data; + writel(0, msm_ps_hold); mdelay(10000); return NOTIFY_DONE; } -static struct notifier_block restart_nb = { - .notifier_call = deassert_pshold, - .priority = 128, -}; - -static int do_msm_poweroff(struct sys_off_data *data) -{ - deassert_pshold(&restart_nb, 0, NULL); - - return NOTIFY_DONE; -} - static int msm_restart_probe(struct platform_device *pdev) { - msm_ps_hold = devm_platform_ioremap_resource(pdev, 0); + void __iomem *msm_ps_hold = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(msm_ps_hold)) return PTR_ERR(msm_ps_hold); - register_restart_handler(&restart_nb); + devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, + 128, do_msm_poweroff, msm_ps_hold); devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_DEFAULT, do_msm_poweroff,