[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1oCNky-006e3g-KA@rmk-PC.armlinux.org.uk>
Date: Fri, 15 Jul 2022 17:01:32 +0100
From: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
"Alvin __ipraga" <alsi@...g-olufsen.dk>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Daniel Scally <djrscally@...il.com>,
"David S. Miller" <davem@...emloft.net>,
DENG Qingfang <dqfext@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
George McCollister <george.mccollister@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hauke Mehrtens <hauke@...ke-m.de>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Jakub Kicinski <kuba@...nel.org>,
Kurt Kanzenbach <kurt@...utronix.de>,
Landen Chao <Landen.Chao@...iatek.com>,
Linus Walleij <linus.walleij@...aro.org>,
linux-acpi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Matthias Brugger <matthias.bgg@...il.com>,
netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Sean Wang <sean.wang@...iatek.com>,
UNGLinuxDriver@...rochip.com,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Marek BehĂșn <kabel@...nel.org>
Subject: [PATCH net-next 2/6] software node: allow named software node to be
created
From: Vladimir Oltean <vladimir.oltean@....com>
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 <vladimir.oltean@....com>
Reviewed-by: Marek BehĂșn <kabel@...nel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
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 0a482212c7e8..b2ea08f0e898 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -972,8 +972,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;
@@ -991,6 +992,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))
@@ -998,6 +1000,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 a5b429d623f6..23330ae2b1fa 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -492,6 +492,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);
--
2.30.2
Powered by blists - more mailing lists