From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8FF0CD11DF for ; Tue, 26 Mar 2024 22:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cPVD16eS8oX04AT7tMoHXYIb2Z9zxtBjEkTOIiTGRHI=; b=kiTXgXeGht69oJ 70G0ULX2gwxRKAIhPRquko7lsWmZjodHoIZ/RpDuAyQsj5Mlma2Fi7GNuxG/oUQdORJtq7QcfthNd jxS1ENNmhUSLm8P7Sw2B8w20eTqULIqB78X3C4s1jwzpGY3YwJsBt9Hb5pbjVSdLqByTtwzONaQSh 713krArdQOtvMxkCKizVqauLq6ysefPdjRG1hSujtEpn94pDu/UIyvUxptO/7EWutbRw/xJD4gt9N g9Yk9Y81/OK67V4SvGxnvKqnGfMgCx8k/GlHLcmDnz3oLhHlMuC7OhR9GdNixmWpzeWZxRfJAPphJ N8w/SLciA/e0bAZjMzIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpFQa-00000006iJp-2hIL; Tue, 26 Mar 2024 22:37:56 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpFQJ-00000006iBd-0lnG for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 22:37:41 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42QMbWGd122550; Tue, 26 Mar 2024 17:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1711492652; bh=Lgm+zMk+iBG2wv4BvI+8VRJEkQ6t3xqJUb4WT18clKA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HOrp+wOsLao8NEe7IbHVfN5R8WnWUCQsZsgd3hFkv1JFOgKqx0z+MxdTmkIItXluo 0U8XqFSbkjhfVBXkqUtZ0aH7XoejlWrUDJUZTM7EQbq2FNn59jdf72ELB4CJhx46Id 0t38enLoiVxe7UNlbyAu8/zIKk+Vm9feTij/2XHU= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42QMbWiL106451 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 26 Mar 2024 17:37:32 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 26 Mar 2024 17:37:31 -0500 Received: from fllvsmtp8.itg.ti.com (10.64.41.158) by DFLE104.ent.ti.com (10.64.6.25) 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; Tue, 26 Mar 2024 17:37:31 -0500 Received: from fllvsmtp8.itg.ti.com ([10.249.42.149]) by fllvsmtp8.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42QMbVmY109669; Tue, 26 Mar 2024 17:37:31 -0500 From: Andrew Davis To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Santosh Shilimkar , Nishanth Menon , Vignesh Raghavendra CC: , , , Andrew Davis Subject: [PATCH 1/4] firmware: ti_sci: Use devm_register_restart_handler() Date: Tue, 26 Mar 2024 17:37:27 -0500 Message-ID: <20240326223730.54639-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326223730.54639-1-afd@ti.com> References: <20240326223730.54639-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_153739_456299_38412236 X-CRM114-Status: GOOD ( 13.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use device life-cycle managed register function to simplify probe. Signed-off-by: Andrew Davis Reviewed-by: Gabriel Somlo --- drivers/firmware/ti_sci.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 8b9a2556de16d..9885e1763591b 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -87,7 +87,6 @@ struct ti_sci_desc { * struct ti_sci_info - Structure representing a TI SCI instance * @dev: Device pointer * @desc: SoC description for this instance - * @nb: Reboot Notifier block * @d: Debugfs file entry * @debug_region: Memory region where the debug message are available * @debug_region_size: Debug region size @@ -103,7 +102,6 @@ struct ti_sci_desc { */ struct ti_sci_info { struct device *dev; - struct notifier_block nb; const struct ti_sci_desc *desc; struct dentry *d; void __iomem *debug_region; @@ -122,7 +120,6 @@ struct ti_sci_info { #define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl) #define handle_to_ti_sci_info(h) container_of(h, struct ti_sci_info, handle) -#define reboot_to_ti_sci_info(n) container_of(n, struct ti_sci_info, nb) #ifdef CONFIG_DEBUG_FS @@ -3254,10 +3251,9 @@ devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev, } EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource); -static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode, - void *cmd) +static int tisci_reboot_handler(struct sys_off_data *data) { - struct ti_sci_info *info = reboot_to_ti_sci_info(nb); + struct ti_sci_info *info = data->cb_data; const struct ti_sci_handle *handle = &info->handle; ti_sci_cmd_core_reboot(handle); @@ -3400,10 +3396,9 @@ static int ti_sci_probe(struct platform_device *pdev) ti_sci_setup_ops(info); if (reboot) { - info->nb.notifier_call = tisci_reboot_handler; - info->nb.priority = 128; - - ret = register_restart_handler(&info->nb); + ret = devm_register_restart_handler(dev, + tisci_reboot_handler, + info); if (ret) { dev_err(dev, "reboot registration fail(%d)\n", ret); goto out; -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel