From patchwork Mon Feb 5 19:44:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 197016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1155153dyb; Mon, 5 Feb 2024 13:28:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFr+hgw3vFzcNKaMNHmCIr6Ak8N1jykePCz+lHPSNG0CgHnkbRizUznghVkieahk4gJCVjm X-Received: by 2002:a17:906:6711:b0:a35:d634:ed71 with SMTP id a17-20020a170906671100b00a35d634ed71mr135885ejp.23.1707168537617; Mon, 05 Feb 2024 13:28:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707168537; cv=pass; d=google.com; s=arc-20160816; b=KnKhros8yKUqd8VKnxyMMglYteDc9KeKW9/IOzeckCCDFfwMoOG+S0MH1SVtQMItxj 3YfwpPpJQooRjE+rfUx3rczud74idOIYAkJiWYkxWhiBbistbpawkP0FGqbqp4m9IHPr 3VQpKAiKfo1POr2uT7POos04sZpbGdd8hbGxuto/ASPdClBlNkj2kTDexHn+Qup6C6m8 CuEZZBkhVuWZvd60M61VG1PG4puiA/dam5y77qZoSsv3KxptjbVFbVp1fOZy6nDOfu18 Rg1sZbr5tkdCYeUBxVLGHYZBbu6X3FiBF0w62hTDtBz1cvPii4KodEH57GeK9Q+z8Vsn 0HKQ== 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=lAKyJIKL98jMQ6gurlzxN/2HSwDVNGSmLpwdS7fp0ow=; b=b9/XjV+DwfgSD0SDUMGwh3eaAd6CHqQ4zDi3nwCRN55zr+tYaIWZehnPRB56cqPQ1e r8cRzGtM6HtHE3EYOpReiVb8lfyt1PqIJqGlI/fCdZbVHDCU6Zxs/1x4Ea1xOz7MVKka XrvG3l1zo7Dz00GAXEjW17xkjMS6n4idS7EFiJxZdFMBcKpSXIfhG2rEdf9Z9YnsXIZF /wEByegnLcDzB10CyNU/oFhzXuI0mFt6FQYfpVIp6xYVWMeuNfvkHnPngyzyRe1a9Oaq QMyJoer7Chhwu6tZtJ2apa8Jhj9bsXAK8p0HDNo7ChR94AHH26Rqi33Zl4U6CEpxxk1c WwjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sTliSK7m; 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-53853-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53853-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCUZnzAIQkqelowkji6B9nYV4hJxmkRbv780oipQr51dIVnkrdWv3A+Kinz84gLKyc0+nghWkscQ3g4T+noOaD94F7U3sg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kq25-20020a170906abd900b00a371fda7cffsi88094ejb.275.2024.02.05.13.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:28:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53853-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sTliSK7m; 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-53853-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53853-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 3192C1F298CC for ; Mon, 5 Feb 2024 21:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 947FB7D40F; Mon, 5 Feb 2024 19:45:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="sTliSK7m" 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 C6209745C9; Mon, 5 Feb 2024 19:45:07 +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=1707162309; cv=none; b=pUOCo+IxV2DxRQJZT6iLhRIy0LunZzCybhF6cPw/N+mWb/3Rlny5WztcLD4gkauS8BM3M5lr3Z3QWmCbb6RNvea7+q3kd38fmarvsPaLgtT4qrR9KAwBsIyWJZcIqMOHbY9SQ5qKiQaq/wgLHA3ocna/Wp88M3cT4XzTZz9ipA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707162309; c=relaxed/simple; bh=iZTSGfwsAJGOr5392OKEepblMvBqT/YAcpCjzijmjmg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vEmH6zNdXOBBIngGC54xIBrHGQ8c+MQ74J4NmvjPdbaF11a5g0iQMIOjb3d2/5maizlCWASpB3sIGg46WbpkvcmuYcTlWr7xmmberyC+OqzUN1yu6URDBijkJ+N+GUR4Axluu8FCHfoIseg2241lOgJ0czhbfMg+vZ4GjD7mUko= 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=sTliSK7m; 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 fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 415Jihlm010943; Mon, 5 Feb 2024 13:44:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707162283; bh=iOS81LCWivcsA7Ov+uMTe+f7Pr/kqVip8XQZGb4u/UM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=sTliSK7mrwvqgEzQR9fDWcHHW1JpaRAuFnBoxmmM2B49apTADPxOEVOqs6Lwq++px 5IMSiUr+9NP7vKk6jR1MrZaqIhq0/wrecr07Nv2EotEwPGb1qFsaflKw+QuNQYad9d 3L+/n8yDsSeIYUYDXXDPhv8x8L+yNjmqnE4KCYv0= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 415JiheV071026 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Feb 2024 13:44:43 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE114.ent.ti.com (157.170.170.25) 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:43 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE115.ent.ti.com (157.170.170.26) 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:43 -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 415JicQU028467; Mon, 5 Feb 2024 13:44:43 -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 07/19] power: reset: brcm-kona-reset: Use devm_register_sys_off_handler(RESTART) Date: Mon, 5 Feb 2024 13:44:25 -0600 Message-ID: <20240205194437.180802-8-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: 1790095956728259232 X-GMAIL-MSGID: 1790095956728259232 Use device life-cycle managed register function to simplify probe. Signed-off-by: Andrew Davis --- 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[] = {