From patchwork Thu Feb 8 17:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp315242dyd; Thu, 8 Feb 2024 09:09:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXMlNDspYWXTa9YJbaHIc4xblllhwtO+MYAHwA8fvbC4+GPPj0jPx1jfvMfk/KxHpIFPZsiEy8c7fsyIrU2BBOtCVi6Fg== X-Google-Smtp-Source: AGHT+IECZhZeh7+j85V+yHsy6XZjaIB1o64MLOpUjB5wBp14dYuhqq+ihvn47Y84D5ldqu4mLCoZ X-Received: by 2002:aa7:d414:0:b0:561:13eb:4adf with SMTP id z20-20020aa7d414000000b0056113eb4adfmr1562522edq.32.1707412142179; Thu, 08 Feb 2024 09:09:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707412142; cv=pass; d=google.com; s=arc-20160816; b=OTZB1AnJNcPYNsWOPySKcQhSmLqscCz9zEwKBiihAAGIs5G63EEJGA7zcJ6wsfsD4Q /JRZHbUMrUdha6zjB1rNrG5jAvU9RThroy7t5TmMpJ/+UFMA3Kf/eJloKPEVF4j1Izhq 11a6lI5yJ+4uz3IH/S1FLjVzxFl7dICyd96wQYRn7EzaQ59swrpIRIFvgO25HPJobVvj iZmWjylhcI5spU9BMRkWWxA7w72ichw3dGkQZxZuvBwakAoOIvoqbaemwG5h6AeR2oN3 u/3pnV8zCtBXxRnay2Hj7qICYp3QaaFv9kFJrbdXPQDKIrI8tFR+NxAtXb4K0YzkmOI5 fAEA== 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=iOS81LCWivcsA7Ov+uMTe+f7Pr/kqVip8XQZGb4u/UM=; fh=bszfjK2IgB86ZrkeELAONt2UQQxLXNqImcGy9fxXCUg=; b=RDwKONsiRhw9hVLTax9rNrqL8feXBnMZJ8jFkbDt5kU8+Xt1e77WGMZGmVSjYiyQXY GhkvSuKO7axb8nl0sFbSGw1d/VdPzUrj+rnFmEtJHv9QyE1xw/1pAN0SA3+LoQtYXbx4 3DK2BTHdY/mOl4HXAv6X2ORTlRRcQDJNfPpHaQQQwnGI6qr7YuXbinvs9GwZuXHp8u4v icldhQNG2/Tc6r3sTwrPJDFEDeM9AytKU9IvhgZMD8/wEbz9gFBPWZe300n46TIivmB6 04v636oe7c1IqVHd0pk3UZfww1v79V6K7JkVEFJjzvBmmx7kUPVvg6x1VphRM33DcU/s PXZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aaDFaUJ5; 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-58411-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58411-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCWijazHeWJZ0dtyNw7tS6gx0Alvbdwc807fiYEKtUJ8ccvgk1M0nXzg1ZQq/bgzuZ3xVhnm7tYpuXUiWiID5cfjEbZNAA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b26-20020aa7cd1a000000b00560ef62a0ffsi1057793edw.84.2024.02.08.09.09.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:09:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58411-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=aaDFaUJ5; 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-58411-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58411-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 C764A1F29163 for ; Thu, 8 Feb 2024 17:09:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A0B412FF9F; 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="aaDFaUJ5" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (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 5A03083CC6; Thu, 8 Feb 2024 17:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411879; cv=none; b=R8oe4BiBuySQ9jO+5PUA52LiSiEfZwR5oBVhiZ+khVcJZUYnVDm4rrj9m/1HRcDIvRqKYJzW0ZJaiAIhMqonZy1+v0Ol7Qf21yZ8K2eMVtTKhEdINVC1/SFe46BBrfA+4pxKwNbeNG3VZFTPO1jxMnkhFabN9BVuo0cdtMsjQag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411879; c=relaxed/simple; bh=iZTSGfwsAJGOr5392OKEepblMvBqT/YAcpCjzijmjmg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hr25GY670sNj5CtOoYENUdheKwdUGFfo//hFEtBUlVl03bqAkA5RTMaOSthYuVaAuRzpzA4Y0X+YAxss5nvpVEd3IT5NxcWVK1ALXDRwMPc099dTKWodaSX32xvvTwWA3ZsnVuLWOtIQuFvmMAxCIjsOHG0Dxsc0kFWm0leg6Wk= 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=aaDFaUJ5; arc=none smtp.client-ip=198.47.23.248 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 lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418H4Hmg018151; Thu, 8 Feb 2024 11:04:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411857; bh=iOS81LCWivcsA7Ov+uMTe+f7Pr/kqVip8XQZGb4u/UM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aaDFaUJ5X7dqHsA2u6lxexH79wO6A5iNlyvbvHTVwOQCNNSAzqkUEZZyQjHekwOBi pkAGk3+lK2TALD448I9OWXwcaQzSTELh8IFkg5WdoruDZRD6WwLwYjcv+nnSQ2QJFm wv+6NWoTotqSoJBWhgjbMtEzRZXSKLaBuRJI2wRw= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418H4HC4042403 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 11:04:17 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) 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; Thu, 8 Feb 2024 11:04:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE102.ent.ti.com (157.170.170.32) 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:17 -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 418H4B69091006; Thu, 8 Feb 2024 11:04:16 -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 07/19] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART) Date: Thu, 8 Feb 2024 11:03:58 -0600 Message-ID: <20240208170410.67975-8-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: 1790351394485297721 X-GMAIL-MSGID: 1790351394485297721 Use device life-cycle managed register function to simplify probe. Signed-off-by: Andrew Davis Reviewed-by: Florian Fainelli --- 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[] = {