From patchwork Wed Mar 22 11:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King \(Oracle\)" X-Patchwork-Id: 666236 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC7A5C6FD1C for ; Wed, 22 Mar 2023 12:00:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjCVMAJ (ORCPT ); Wed, 22 Mar 2023 08:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjCVMAI (ORCPT ); Wed, 22 Mar 2023 08:00:08 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4730957D13; Wed, 22 Mar 2023 05:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XgMHT2HBO+8IToVuu3CA3Bsm2bp98QNQ8P5z5X5y8NU=; b=0NtkeN4qMvD7jDiREWvOyJSCU0 f3Lv1ZtKAZb9ei8pVbIdKxj+P3SZjrBkDw7+h48o84JIklRnwWW1x7B5aQobKV2iUUu3KKPzdgJlK nplWfaw+n33TZMDanvNXgjErMpdTWvYMW+bf3KA39R0JE20QLhhcbv2hoL/TkDUNlBp+WoWcERamu z9WKfuzbv2muUa7lEWqc0Ysu5BlXc25XlLIuEpl12l2mY10qBW4BEQsTaz0H5N4+kxzC03VMVvwxS ye404ej6R97DeeigjNz17nHAQ9/55auGtNK+SVqJOLdQQ8gglSQ5h6ZLQ0PQrXcipWdvV2ZNP6KeP mbDf02aQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37338 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pex8G-00035B-Ig; Wed, 22 Mar 2023 11:59:56 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pex8F-00Dvnf-Sm; Wed, 22 Mar 2023 11:59:55 +0000 In-Reply-To: References: From: Russell King (Oracle) To: Andrew Lunn , Heiner Kallweit Cc: Andy Shevchenko , Daniel Scally , "David S. Miller" , Eric Dumazet , Florian Fainelli , Greg Kroah-Hartman , Heikki Krogerus , Jakub Kicinski , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, Paolo Abeni , "Rafael J. Wysocki" , Sakari Ailus , Vladimir Oltean Subject: [PATCH RFC net-next 1/7] software node: allow named software node to be created MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 22 Mar 2023 11:59:55 +0000 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Vladimir Oltean Allow a named software node to be created, which is needed for software nodes for a fixed-link specification for DSA. Signed-off-by: Vladimir Oltean Signed-off-by: Russell King (Oracle) --- drivers/base/swnode.c | 14 ++++++++++++-- include/linux/property.h | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 1886995a0b3a..e4d07e1655a9 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -911,8 +911,9 @@ void software_node_unregister(const struct software_node *node) EXPORT_SYMBOL_GPL(software_node_unregister); struct fwnode_handle * -fwnode_create_software_node(const struct property_entry *properties, - const struct fwnode_handle *parent) +fwnode_create_named_software_node(const struct property_entry *properties, + const struct fwnode_handle *parent, + const char *name) { struct fwnode_handle *fwnode; struct software_node *node; @@ -930,6 +931,7 @@ fwnode_create_software_node(const struct property_entry *properties, return ERR_CAST(node); node->parent = p ? p->node : NULL; + node->name = name; fwnode = swnode_register(node, p, 1); if (IS_ERR(fwnode)) @@ -937,6 +939,14 @@ fwnode_create_software_node(const struct property_entry *properties, return fwnode; } +EXPORT_SYMBOL_GPL(fwnode_create_named_software_node); + +struct fwnode_handle * +fwnode_create_software_node(const struct property_entry *properties, + const struct fwnode_handle *parent) +{ + return fwnode_create_named_software_node(properties, parent, NULL); +} EXPORT_SYMBOL_GPL(fwnode_create_software_node); void fwnode_remove_software_node(struct fwnode_handle *fwnode) diff --git a/include/linux/property.h b/include/linux/property.h index 0a29db15ff34..f7100e836eb4 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -495,6 +495,10 @@ void software_node_unregister(const struct software_node *node); struct fwnode_handle * fwnode_create_software_node(const struct property_entry *properties, const struct fwnode_handle *parent); +struct fwnode_handle * +fwnode_create_named_software_node(const struct property_entry *properties, + const struct fwnode_handle *parent, + const char *name); void fwnode_remove_software_node(struct fwnode_handle *fwnode); int device_add_software_node(struct device *dev, const struct software_node *node);