Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp745097rdb; Tue, 23 Jan 2024 13:45:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFvgTYqvjW+TDUhjaE/waSXywxlvAkevPPb9uogap3V8E9MO4XJBgOKd3wegJ05Ikql1cY X-Received: by 2002:a05:6a00:398e:b0:6d9:a15d:1101 with SMTP id fi14-20020a056a00398e00b006d9a15d1101mr9795229pfb.54.1706046301569; Tue, 23 Jan 2024 13:45:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706046301; cv=pass; d=google.com; s=arc-20160816; b=zWRpA//ezT8ViB0qXupEEPmNSwStpEMOzjKceSf/cVZ9SX6p5hArDhnGw7suxN2/qh 4aIWsfGCpjNYV1aBOKP7+LtPx5Ie6PzvpWBtlM3S5iRMwIAPv1bdbj7V6/eh2xnK84IQ hxkfPjzFxuFllRzC5TH8b3X37SOOshAIDfvoN0JsemGsJzPHXPyZQ/U9ixpxGdbEz1m9 drRjSVPGvJr0lCIuQa8H3+Qdfhs6PJ8uQD//P7iHcQ8dXyTgLLn+bgu7RilcHcRsoJ+/ esKgL1TRcwYjauNfWkZP9M9TztW/8D84sRZwXDIQuZYfo0OPo9O0qKWP5efB76se3Cyr Hwng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+3MCPcQUCArKpNYmWhAQQTPpuom6plcd1PN16ZZMXig=; fh=cDOU83KxtfLhixwiiitR0hvv8Y4HRd1t34KdPk8FqWs=; b=meCENNLd3ukzqrgH8+Pcupau9lJ3s7vDQ1HPHjbZycHVAa5k9OMMcn3Hm2U39LLKPT JZ6TDZLCbpxf1PCO8Tz8sqcOuYA97VtnbPVQi5OQ9kCExKXTZPvEUrVnmg5y1tNPHvvP 3UuY180nKIazEAegefFuOXTm+21lsVOa9NF/Qt93y4Pbjubjq0f6LUStOMYMLMeOPWRr D4sne6WZtKdJrRyZfSEq5likRO4kyM3Y0mkislGEesb5yV5VnmTILwsWK8Z9DdoalZIV i0/9R19Yf8X/TcY3Ipo+zWI6VPZRmgtMsagZzye+Cjih1jLOTjYSxR2FZylohYuce60d j9MQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YgoENUiO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t1-20020a056a00138100b006dbac97dfccsi10063359pfg.141.2024.01.23.13.45.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:45:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YgoENUiO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-36084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 37A7328609A for ; Tue, 23 Jan 2024 21:45:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E28C048CDC; Tue, 23 Jan 2024 21:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YgoENUiO" Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3A073D566; Tue, 23 Jan 2024 21:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706046287; cv=none; b=hgh60MIWdiGRTfPTYVOfZY7zQostslpc+UDmSzPAkvlcPB9+SDRhVjZiiwdmdxLnrf4+gGsMeu/XNXXu0ZqSkbh075Djj+QIqkXDel3EXCjd7izxPvtfDw6VWpwfJ8B4H66CgrrvidkK9ku+OBAQE4LwAJTK0BQ8s45kqEQLfp8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706046287; c=relaxed/simple; bh=vDnjpIIbP4NzaPlkT4a++LVS2cc7fwQ3SA5eIisuHQM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OVg+octsuWGpu1geNn008lCGkEmrhRrADN3DzQ3SKX2tyeWK8ZB3paywNZPTrzAq5sMcwONGyAm/+pTk4WwoLs5iYZ9D/NxYebuRrg06mtop81IrNSLVWxYvBW7Ix9Jgr/B3JUR9IBVDjogLTITYNGL4wpJQkWlElyOmuQmf3dI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YgoENUiO; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-68195c0c8d1so19601096d6.3; Tue, 23 Jan 2024 13:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706046284; x=1706651084; darn=vger.kernel.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=YgoENUiOl0nq2N4AoetuYFjywC/QF/MHWSxF0Gbw/+Ig4PF/WfeblUyf5wGYWxcj11 7Yuijxg+LLih0StjpiQPBalqoNCOd5QHnX9vyoSDObUXMIf8mN1yiJOWdhD+SC/PIQxm Ua4PyW9uzB6VutWRycMmgbjAt+sapPdbvsIwSKpkzaklnGst7ZWqCa2mSd1btQL0lpf5 Vm643RoaBSPV5ZTB8UZvS74+6W2LChFjidrbd1cHA6LkCFyOMRqyjHPsrXIXo9Saf06c HZhbVgv1tDQvQuHQRULTt3wrj2/84E+CE8HKSCuiSms4jVA19HMBo3odTQCoYHo0Wnu/ mMxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706046284; x=1706651084; 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=LBRhobvco9H+6CHjrSibz+EG9Vx9UxY+Ma4+x7d1bR9yELRDPRJfR8iflmqbJLfPnd NeQTi0/taGCqbNj0NlyGuTrjudc5MYkZI26hXxM2CBTZnVm3AEvTyr7FZ+oIywCockC/ 6ZM1wgcgW0E4cdffLCtH96UdwnuT407iGcOuPgIRAxKfPWLt8qlHkVis2hdM2MZwIdma yE77L2hJ9FfNv8Y2VA9xxQMcDnjnS+v/ISiMvOnb8UWGASEJuJgqjnojjHdS+bkEl2PN 0vMENnzUfoIjPPIzYmr4VnQJcTgl3V1qPY47aD9IYsf2wpfFXVz7Ea6RfM36YkqMq51V JDfQ== X-Gm-Message-State: AOJu0Yz8pUai9xdyc84huYiubSAEhpuYABgOxwrLYQAN8+hT8YjC7Is/ tfnAxZ2tbLkvsyHx3KxVX/Y05M91zTsLBi6JxzTaedkUqtgk61nx 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240123164443.394642-5-afd@ti.com> X-Clacks-Overhead: GNU Terry Pratchett 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 >