Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp90458lqf; Tue, 26 Mar 2024 15:38:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHAWQspQAdQGgNYc2uUOQ+keaowZZtOuY3QS35zN8Wh3ZL76yfEhxazXQ6M/OGAx7/t4tLygDEMLyaPSqdDLpUjcZcbpxMcSuC1F6sEQ== X-Google-Smtp-Source: AGHT+IGOqcK3aNYdltSwKBBo/Xg2pVRZS9g5Men6vIO6+LxdhWnK1wrVz4BaZrQlmVO8zeihJKml X-Received: by 2002:a05:6214:4c07:b0:696:aa5e:6143 with SMTP id qh7-20020a0562144c0700b00696aa5e6143mr488923qvb.11.1711492722451; Tue, 26 Mar 2024 15:38:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711492722; cv=pass; d=google.com; s=arc-20160816; b=BKBy4otTPbmmT2mX4+2kaxkr3zv1viUuDbTv7qsL3XDj53g1ZRPo7fBHMJ/CrFRTIF Dmy+ZGDnCaXxRQIkk1K46ojR+ng/5Tn5/5Z+LtSWtMIVQwKJ/GunK0j2w/Z/dcRtSMa4 vpjkxS0PS3vl0WQu4Sg5r8uBowSGYDoTFj8v//riNFHPcK1dYlleCoaR4N2v5s0RZkOi vdXimqppRGd0Acx0dTA7DGkoPp1Ji7lOwmi+TfgU6zF+f3CNatyyMnTabF9ZW/1uIkBR plaa+51k7KNv9UtVvJjJGAxu1LROkETZZqsqMY5ulKcqCpuXqnmv+v4EqTDtrEff5a4l jVWA== 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=Lgm+zMk+iBG2wv4BvI+8VRJEkQ6t3xqJUb4WT18clKA=; fh=b7/hHv7K5amIKNewyZEDQtzYYqgbOIe2Fyqdpv62eJg=; b=HFSW7Opxk2OHim1VfsCFWpPcZGZQr49bg/5XJaVethByjPE+JFThiMRDjvm7bECvPA ElBMpLT3qB1DpE3RRY33PwmLEDidZRFPlOnOoda8eRYe1vJuS/Iev47dXFMEVbHqONbX gquGfrrJ2AgXYNMWWq+cDpk3eSi3D5T3glEz4gFJPVVSXz8yFelq2lwNtRO3Wd/nQam2 83f0IdmPI34BEz1QoBpz/IdgDklpHDpE0dq6JvRGptsAolLVfIsviE+76Iay5MT8d3s1 7aV5sEEGNadQabULixjX3oqINGzei7rdNYrTzK3qpLpVVRewVXp4dTrZvm9kUSE8yTCB 6O+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HOrp+wOs; 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-120069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120069-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o7-20020ad45c87000000b0069688935d23si6639133qvh.453.2024.03.26.15.38.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:38:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HOrp+wOs; 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-120069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120069-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 23A951C2D21A for ; Tue, 26 Mar 2024 22:38:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92DBE8664C; Tue, 26 Mar 2024 22:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="HOrp+wOs" 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 78F8C13E021; Tue, 26 Mar 2024 22:37:42 +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=1711492664; cv=none; b=bNjOxtmxYGpjGVERCWhXQjlXAS315wmReyi8YlzQNzWVm6Fap8c53MhDgOrBscVPmgB65fvZEnnc9SyxJvf53EzIP3uFGF22CY2umaG7vKSXL7pEXyVR6mUUwur6OYee6FV2DqRlKw+RJm0St74PnFsRRfnHLbKiz5MBKYaLYQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711492664; c=relaxed/simple; bh=KfCKmYHywoKaCHHGNRiQeIrXMDQOxpWG74uFDT0bwKI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NaL0cZSVMJs+eXfEj1DmF/pIv2yf0BCG2cP7Wi9Whvojv/9r8ivPNzYl2AAVLOSeXB8FBhk0kEbrkSELX4e5NJXubP+VU7f1xrWwp/CCgL1kosow9RAk+nm0CeqpLokmIoLQ3Zlc58r6LGpdKAjSrqwynPdBiPj3aXZKVHas3d8= 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=HOrp+wOs; 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 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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