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 651D0C47DDB for ; Tue, 23 Jan 2024 21:45:23 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F6eQZEFGWNrSnTro0gON21Dv42H3Fkt0AwRNPV4s4Dw=; b=sftBDUdkhOjykk KxKyJiUnZ2skqcD7wKbTJ3htM4h1RX5EdvMoIN4c/jhHDGWP50lIIIrMSP0ZViko9J0qB0tTp1Wfd LVZt6OB0AP3kt0wNeWPc+yS4ZnpIR4fKG+aaqh3gg+stcxNBYJ/7askdROUhMNC0o/eVYJxTb9WPa aWXjY4iLHqa2uJqCvx1CfBzFiShLapELn4MSOBtxaS95/ErtI5kW3zHhjRl4uLZb4BvPh6Xagx5mU pen32/lb9My+96L/T0g69NuRjZcQmukICR8MQXPv+HHM+Srr6A6NjdbBlHJI4xkR2RXyo6M1/D+v9 jUK/ghiaxiCbt/LhNolA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSOZj-000ZDt-1m; Tue, 23 Jan 2024 21:44:55 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSOZg-000ZCD-1D for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 21:44:53 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-783137d7fb4so318063685a.2 for ; Tue, 23 Jan 2024 13:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706046285; x=1706651085; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+3MCPcQUCArKpNYmWhAQQTPpuom6plcd1PN16ZZMXig=; b=MqyybiEwr/dIKZnci8VFIKpcUcvk7uM11kxnemhCqt7n7D6pK10wkCdUyX5cVZ65oC gKhDcSFebSwYXPyzFfyD1PC6hs3kVQwk6LP3G2AJBoX1pdzqFwgRLw/RIi1NNXyx23nd ijgjG6cHq22olv9Hhvnz8+PL+lOxLca6LPDrCNOqvopnBokuO2Bhd52mTv3DS5Uk3/vg sgfJ2qpdoFqM8mr1i4hsESMLDTar5qgkDSKA7EZV4lHPkHk3zuEPdzhLw+2fWnXNaOlP h9y3wIhwjmAKT3oscrqALmt2WAa6S/HCCmKZ+MdJbEN6dGG1U8tT23CiFNP2zIm2+xlW 2MAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706046285; x=1706651085; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+3MCPcQUCArKpNYmWhAQQTPpuom6plcd1PN16ZZMXig=; b=wYbTeumwdfwrqaUrRQeOZvNsxNd/H6UHEXbXroaMOVPEKCHodJCna9NsZctMDwE1kG KlaMPxwqiCpdIY4Vlw3+tYsi0LKLfn323Fbuin41e96EyJxQNJId2sYPlRX9plxrqfsJ scvsFvlNsvSEU4FXNdMz1HVD9QO3GxuaX2/KsOWb9j26JsMu61KsREUgLSgZt2jZmibN IPqfcAWtmzbDWo7OGLWl6B4b7RRiYUULTRxKmNJn0IgXXksWnyqYIfdrfj9g7ZKDheYj HV3jBoAbXQY1czmDDNIPMhYxkV8hfbHPKW9+lLGBYg6lOSCxIrc3HfFFuMiT4zoX/bt0 9OOA== X-Gm-Message-State: AOJu0Yy00tfxaCIe4XPpbHcOxgk7HJfHRpLSNJudQ8B+hIj6jAQ3WEqX xFbGDdkkRq5EhhclATssV5s1eHFRktKOna/IeGgobJvz079uIxfs X-Google-Smtp-Source: AGHT+IEnM4O/QvGUTq4CzT6ynknyJ6uSBpQcVtYap/v7zSMVnEgBOB3nMcUgxjrQKSrrA3y6M3Nxzg== X-Received: by 2002:ad4:5f0e:0:b0:681:7963:2aa8 with SMTP id fo14-20020ad45f0e000000b0068179632aa8mr1246200qvb.130.1706046284432; Tue, 23 Jan 2024 13:44:44 -0800 (PST) Received: from errol.ini.cmu.edu ([72.95.245.133]) by smtp.gmail.com with ESMTPSA id nf3-20020a0562143b8300b00685ad9090basm3606011qvb.97.2024.01.23.13.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:44:43 -0800 (PST) Date: Tue, 23 Jan 2024 16:44:42 -0500 From: "Gabriel L. Somlo" To: Andrew Davis Cc: Mark Rutland , Lorenzo Pieralisi , Sebastian Reichel , Karol Gugala , Mateusz Holenko , Joel Stanley , Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang , Lee Jones , Dmitry Osipenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-spi@vger.kernel.org Subject: Re: [PATCH 4/4] firmware: ti_sci: Use devm_register_restart_handler() Message-ID: References: <20240123164443.394642-1-afd@ti.com> <20240123164443.394642-5-afd@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240123164443.394642-5-afd@ti.com> X-Clacks-Overhead: GNU Terry Pratchett X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_134452_410055_78C0F2BD X-CRM114-Status: GOOD ( 19.82 ) 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 On Tue, Jan 23, 2024 at 10:44:43AM -0600, Andrew Davis wrote: > Use device life-cycle managed register function to simplify probe. > > Signed-off-by: Andrew Davis Reviewed-by: Gabriel Somlo > --- > drivers/firmware/ti_sci.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c > index 8b9a2556de16d..16501aa0b84cf 100644 > --- a/drivers/firmware/ti_sci.c > +++ b/drivers/firmware/ti_sci.c > @@ -103,7 +103,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 +121,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 +3252,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 +3397,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