From nobody Thu Nov 14 04:55:09 2024 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 0F5BF3E476; Mon, 12 Feb 2024 16:28:49 +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=1707755331; cv=none; b=n2eftKhH3TqczU9UbSjionRHaIlIimeQRvtRBvSUBa7M/zO+Cm0eXwm23GkWQGpEppnNLZeB7Nqy8uSNI/oNKj9zjf/Kx7IALcq+HuPhxctsyhl7wnMNWcQho6ZjQCPLxpb6lBtS6NFDqwQ+DFlSR8ofWQBVr3zObPw9I56l2jA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755331; c=relaxed/simple; bh=QekKnIF+GkovKO7gb14ZkIhecaU+qacpUcgS7SjOB24=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K65fdsGzqm0R0A2I1hJI4SDK4yQ1wYl9EyXa4JKh1sAHLr0tdO1FrFmL9jXOO9f0tLYFTDKdsg9pDwj8byQNtsws7pZaWQ9C+VF1FLgOVkUsdVQ+JlujFT50TM0jafyv6Sz1UpZ36gBtAzjzlwF3IDvzCs2T1YxSNRnoOmV0nvY= 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=DrBTLoeP; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="DrBTLoeP" Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41CGScsB080181; Mon, 12 Feb 2024 10:28:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707755318; bh=2TI8f8x/5Y4Kr2Vxqhq6Wi5Pu8tSR0ICKXsQgkmtu64=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=DrBTLoePLehswdRPNH+vUAWqNvS2RdzEsDCDcwlSakra+jODIW6BGbJ+jHKU3N/Uu f50kNvK/DKr7sOwR19Zil95AEpMh2AYNptIWtLM2p4iNjarMe4esDtyIRpRwbrxisb kOews5OxauxAOg9SkBR6a4MbN6N6Sv022qN2QXtQ= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41CGScnF008721 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 12 Feb 2024 10:28:38 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE109.ent.ti.com (157.170.170.41) 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:38 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE105.ent.ti.com (157.170.170.35) 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:38 -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 41CGSWR4090688; Mon, 12 Feb 2024 10:28:37 -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 v4 08/19] power: reset: axxia-reset: Use devm_register_sys_off_handler(RESTART) Date: Mon, 12 Feb 2024 10:28:20 -0600 Message-ID: <20240212162831.67838-9-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Content-Type: text/plain; charset="utf-8" Use device life-cycle managed register function to simplify probe. Signed-off-by: Andrew Davis --- drivers/power/reset/axxia-reset.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/power/reset/axxia-reset.c b/drivers/power/reset/axxia-= reset.c index 24946766760c3..797bf6773860e 100644 --- a/drivers/power/reset/axxia-reset.c +++ b/drivers/power/reset/axxia-reset.c @@ -26,11 +26,10 @@ #define SC_EFUSE_INT_STATUS 0x180c #define EFUSE_READ_DONE (1<<31) =20 -static struct regmap *syscon; - -static int axxia_restart_handler(struct notifier_block *this, - unsigned long mode, void *cmd) +static int axxia_restart_handler(struct sys_off_data *data) { + struct regmap *syscon =3D data->cb_data; + /* Access Key (0xab) */ regmap_write(syscon, SC_CRIT_WRITE_KEY, 0xab); /* Select internal boot from 0xffff0000 */ @@ -44,14 +43,10 @@ static int axxia_restart_handler(struct notifier_block = *this, return NOTIFY_DONE; } =20 -static struct notifier_block axxia_restart_nb =3D { - .notifier_call =3D axxia_restart_handler, - .priority =3D 128, -}; - static int axxia_reset_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; + struct regmap *syscon; int err; =20 syscon =3D syscon_regmap_lookup_by_phandle(dev->of_node, "syscon"); @@ -60,7 +55,8 @@ static int axxia_reset_probe(struct platform_device *pdev) return PTR_ERR(syscon); } =20 - err =3D register_restart_handler(&axxia_restart_nb); + err =3D devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, + 128, axxia_restart_handler, syscon); if (err) dev_err(dev, "cannot register restart handler (err=3D%d)\n", err); =20 --=20 2.39.2