[v4,07/19] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART)
Message ID | 20240212162831.67838-8-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-61966-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp29577dyb; Mon, 12 Feb 2024 08:32:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUR9mbXOTxeuiqce8Tp2JoGPihVGutJLsIQqZ/ZchlYOuxbEFb+ySjPREW0JuvsczRjXjjWqmkVBJTktpe7t+rRpPzUMQ== X-Google-Smtp-Source: AGHT+IEw5de84sFZrut043l1k2FIOY40EUaBiiNAtV99VmX+EFu+S3+qw3l2EPBRhVGo6nD8Jpav X-Received: by 2002:a05:6a20:c88d:b0:19e:443c:1202 with SMTP id hb13-20020a056a20c88d00b0019e443c1202mr6018726pzb.26.1707755569112; Mon, 12 Feb 2024 08:32:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707755569; cv=pass; d=google.com; s=arc-20160816; b=ktit9leItiPKqfgfhYQjnvolZ4dM/o1wciM52nQ84L++qv7hPAiQwfvv+ltdiAh3rx jPTtDQKq8n1AxBuN5T/ARzKGO88Z181vHLmSFyIMfPV87deNde9s41UwVDDUxmgSHEwq q9kaEV2fl5bN0b026+Jg7OTgkVrfGm5JyVZT9XfLogRvCwo7WbLjuPoMjY2Qaxe8AQTi 5oyCUcGp//mXWeD8yOncgc9EiGbUTd5ZDxlkwKvb6zev7QHshpgy7E22+rkIZv0FS9Dk 8gVVCYseSX8a51Q66yLgX9/Y0leKeevhvG1jFMalaxzGem0Nr2GNs5SgvSednyyEjW9G n+Cw== 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=LGLUxvVXiFpOwGVZHJ/g7QXxTLnfINRjy9wvFXeu9qc=; fh=0l5laeve2TgtvWT1jP/c5+IKr8IBewAgeCTI/uRWj94=; b=fpqQQFWdM7gkRUXhU18V8fr+94G2pDyHR+LgZSazQSjtp5OXnz8LZqhIHlifJd/PhF XAlpCfvgmVcLL14UsJYKMM2I2oWnzGTKD3TWmpq23TH9+pkXhA84bNAVicEA/ydhHub/ TkHgJ22W1Vi1BzLqW3ok4l5qA+gD4eRQV7a/XLYmWe/pxnL9Zk2d6c5dQHbowSHumZNM LBrnr03GLbsXIgk9kG9trKGJk1ToQwFapeNzjb3AuVNfsT61Hgze6COnB8lSZIN3ImiO JRn3lTNJ6tErAArGmUBhYOkM8ws7KeYaGUfSc2t3PNxGWghJk8/cfkbYRSF8aWznQahD U2Qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RSwCipk5; 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-61966-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61966-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCXvGbL0nnPMhBpIWMqL9OQW4Oqco4US4mdt+3WcA7hONpEbnJxYPylJBjROQDBIHpJLL2egEGRDImfXUfki2p80W/NigA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y21-20020a637d15000000b005d8b59fe766si445649pgc.457.2024.02.12.08.32.49 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:32:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61966-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RSwCipk5; 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-61966-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61966-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 DFDC02821F3 for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 16:32:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CFF7481D5; Mon, 12 Feb 2024 16:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="RSwCipk5" 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 9DEEF3F8F5; Mon, 12 Feb 2024 16:28:51 +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=1707755333; cv=none; b=bKSFUcGd4JC8U8Z0WFmzBB9yUExvVOGzZxMJLdM0Q9CDi/GlULa6DoKsxKpWapVKPaGPz61LSFCGcM76QIBAYOaaIoUtt86lgVLimE37O+18oNk+qUAZuO4c78bWkzYqD1W9SSWhJ5ajrNmkUdLFZ2C/7I1WJANPIqc77LZpVR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755333; c=relaxed/simple; bh=df03AKZk+heiDudJQkfc7tqfbv46PxpdpOE2Z5rnv1M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aqJFadLI6Tbdm26nBY/+QZIFMmKDOfRjAUqyh6mTWCziAdBbmDiNWbhm7QAfWy8bsDx3qeuKJijVG+j5nQKQkufSdR2NepRaIiNiitHpJNmTo93k4gyYZ3bG77mEUAifafm8Km35BUy5weyjty+jUYuYhpSiNvKZG0QJtc8UjdM= 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=RSwCipk5; 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 fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41CGSb75068402; Mon, 12 Feb 2024 10:28:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707755317; bh=LGLUxvVXiFpOwGVZHJ/g7QXxTLnfINRjy9wvFXeu9qc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RSwCipk5R38DDzp/u55eEnWAxlwX/BD2Q5vkm6IDwXHJ98sKM55hH4dKihPG6wM5H XFAjWPy6fmVyDGWxFNadylLkif2metIsbfwf0GVS23zr0kf0I17t6W5QWQWNlxpwq/ XuPnQQN0e2CLcH43flzezGWpsYOKsIP3aTXfqpmw= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41CGSb7U046923 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 12 Feb 2024 10:28:37 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) 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, 12 Feb 2024 10:28:37 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE111.ent.ti.com (157.170.170.22) 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, 12 Feb 2024 10:28:37 -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 41CGSWR3090688; Mon, 12 Feb 2024 10:28:36 -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 v4 07/19] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART) Date: Mon, 12 Feb 2024 10:28:19 -0600 Message-ID: <20240212162831.67838-8-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212162831.67838-1-afd@ti.com> References: <20240212162831.67838-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: 1790711503613242926 X-GMAIL-MSGID: 1790711503613242926 |
Series |
Remove pm_power_off use in drivers/power/reset
|
|
Commit Message
Andrew Davis
Feb. 12, 2024, 4:28 p.m. UTC
Use device life-cycle managed register function to simplify probe. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> --- drivers/power/reset/brcm-kona-reset.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/power/reset/brcm-kona-reset.c b/drivers/power/reset/brcm-kona-reset.c index d05728b1db097..ee3f1bb976530 100644 --- a/drivers/power/reset/brcm-kona-reset.c +++ b/drivers/power/reset/brcm-kona-reset.c @@ -15,8 +15,7 @@ static void __iomem *kona_reset_base; -static int kona_reset_handler(struct notifier_block *this, - unsigned long mode, void *cmd) +static int kona_reset_handler(struct sys_off_data *data) { /* * A soft reset is triggered by writing a 0 to bit 0 of the soft reset @@ -31,18 +30,14 @@ static int kona_reset_handler(struct notifier_block *this, return NOTIFY_DONE; } -static struct notifier_block kona_reset_nb = { - .notifier_call = kona_reset_handler, - .priority = 128, -}; - static int kona_reset_probe(struct platform_device *pdev) { kona_reset_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(kona_reset_base)) return PTR_ERR(kona_reset_base); - return register_restart_handler(&kona_reset_nb); + return devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, + 128, kona_reset_handler, NULL); } static const struct of_device_id of_match[] = {