* [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
@ 2026-04-02 14:15 ` Bartosz Golaszewski
2026-04-02 16:39 ` Danilo Krummrich
2026-04-02 14:15 ` [PATCH v5 2/4] software node: remove software_node_exit() Bartosz Golaszewski
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-02 14:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
linux-omap, Bartosz Golaszewski
Software nodes depend on kernel_kobj which is initialized pretty late
into the boot process - as a core_initcall(). Ahead of moving the
software node initialization to driver_init() we must first make
kernel_kobj available before it.
Make ksysfs_init() visible in a new header - ksysfs.h - and call it in
do_basic_setup() right before driver_init().
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
MAINTAINERS | 1 +
include/linux/ksysfs.h | 8 ++++++++
init/main.c | 2 ++
kernel/ksysfs.c | 9 ++++-----
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0f258aeeacba184d2025b932d90280cf2aabf4b0..8bc934162e712cf8ddf033e53bf3481054cfb7fe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7843,6 +7843,7 @@ F: include/linux/debugfs.h
F: include/linux/device.h
F: include/linux/fwnode.h
F: include/linux/kobj*
+F: include/linux/ksysfs.h
F: include/linux/property.h
F: include/linux/sysfs.h
F: lib/kobj*
diff --git a/include/linux/ksysfs.h b/include/linux/ksysfs.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7dc6e18f28e8a12a66d64ffffb13749d424a881
--- /dev/null
+++ b/include/linux/ksysfs.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _KSYSFS_H_
+#define _KSYSFS_H_
+
+void ksysfs_init(void);
+
+#endif /* _KSYSFS_H_ */
diff --git a/init/main.c b/init/main.c
index 8b7633b7ab720b9c13a231d64291d35d3852602c..96f93bb06c49013bae8d3d6b7afca13d6277a868 100644
--- a/init/main.c
+++ b/init/main.c
@@ -36,6 +36,7 @@
#include <linux/kmod.h>
#include <linux/kprobes.h>
#include <linux/kmsan.h>
+#include <linux/ksysfs.h>
#include <linux/vmalloc.h>
#include <linux/kernel_stat.h>
#include <linux/start_kernel.h>
@@ -1482,6 +1483,7 @@ static void __init do_initcalls(void)
static void __init do_basic_setup(void)
{
cpuset_init_smp();
+ ksysfs_init();
driver_init();
init_irq_proc();
do_ctors();
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index a9e6354d9e2579317d3b1bcb54223432d3ce0950..f45ade718054af4eb72fba88dab10c86287986ee 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -8,6 +8,7 @@
#include <asm/byteorder.h>
#include <linux/kobject.h>
+#include <linux/ksysfs.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/export.h>
@@ -213,7 +214,7 @@ static const struct attribute_group kernel_attr_group = {
.attrs = kernel_attrs,
};
-static int __init ksysfs_init(void)
+void __init ksysfs_init(void)
{
int error;
@@ -234,14 +235,12 @@ static int __init ksysfs_init(void)
goto group_exit;
}
- return 0;
+ return;
group_exit:
sysfs_remove_group(kernel_kobj, &kernel_attr_group);
kset_exit:
kobject_put(kernel_kobj);
exit:
- return error;
+ pr_err("failed to initialize the kernel kobject: %d\n", error);
}
-
-core_initcall(ksysfs_init);
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier
2026-04-02 14:15 ` [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier Bartosz Golaszewski
@ 2026-04-02 16:39 ` Danilo Krummrich
2026-04-02 16:40 ` Bartosz Golaszewski
0 siblings, 1 reply; 15+ messages in thread
From: Danilo Krummrich @ 2026-04-02 16:39 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Andy Shevchenko,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu Apr 2, 2026 at 4:15 PM CEST, Bartosz Golaszewski wrote:
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0f258aeeacba184d2025b932d90280cf2aabf4b0..8bc934162e712cf8ddf033e53bf3481054cfb7fe 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7843,6 +7843,7 @@ F: include/linux/debugfs.h
> F: include/linux/device.h
> F: include/linux/fwnode.h
> F: include/linux/kobj*
> +F: include/linux/ksysfs.h
Currently, kernel/ksysfs.c is not listed in the driver core entry (it is not in
any entry), but I guess that would make sense.
So, we should probably also add kernel/ksysfs.c. :) But this can be a separate
patch independent of this series.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier
2026-04-02 16:39 ` Danilo Krummrich
@ 2026-04-02 16:40 ` Bartosz Golaszewski
0 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-02 16:40 UTC (permalink / raw)
To: Danilo Krummrich
Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Dmitry Torokhov, Kevin Hilman, Arnd Bergmann, driver-core,
linux-kernel, linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 2, 2026 at 6:39 PM Danilo Krummrich <dakr@kernel.org> wrote:
>
> On Thu Apr 2, 2026 at 4:15 PM CEST, Bartosz Golaszewski wrote:
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 0f258aeeacba184d2025b932d90280cf2aabf4b0..8bc934162e712cf8ddf033e53bf3481054cfb7fe 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -7843,6 +7843,7 @@ F: include/linux/debugfs.h
> > F: include/linux/device.h
> > F: include/linux/fwnode.h
> > F: include/linux/kobj*
> > +F: include/linux/ksysfs.h
>
> Currently, kernel/ksysfs.c is not listed in the driver core entry (it is not in
> any entry), but I guess that would make sense.
>
> So, we should probably also add kernel/ksysfs.c. :) But this can be a separate
> patch independent of this series.
Ok, I take it no need to resend this?
Bart
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v5 2/4] software node: remove software_node_exit()
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
2026-04-02 14:15 ` [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier Bartosz Golaszewski
@ 2026-04-02 14:15 ` Bartosz Golaszewski
2026-04-02 16:19 ` Andy Shevchenko
2026-04-02 14:15 ` [PATCH v5 3/4] driver core: make software nodes available earlier Bartosz Golaszewski
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-02 14:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
linux-omap, Bartosz Golaszewski
software_node_exit() is an __exitcall() in a built-in compilation unit
so effectively dead code. Remove it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/base/swnode.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 51320837f3a9f1bf4f65aa161d9b941affc74936..26cbe1c2a2e043a2315764085207561069c23ccd 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -1135,10 +1135,3 @@ static int __init software_node_init(void)
return 0;
}
postcore_initcall(software_node_init);
-
-static void __exit software_node_exit(void)
-{
- ida_destroy(&swnode_root_ids);
- kset_unregister(swnode_kset);
-}
-__exitcall(software_node_exit);
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v5 2/4] software node: remove software_node_exit()
2026-04-02 14:15 ` [PATCH v5 2/4] software node: remove software_node_exit() Bartosz Golaszewski
@ 2026-04-02 16:19 ` Andy Shevchenko
2026-04-02 19:46 ` Dmitry Torokhov
0 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2026-04-02 16:19 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 02, 2026 at 04:15:03PM +0200, Bartosz Golaszewski wrote:
> software_node_exit() is an __exitcall() in a built-in compilation unit
> so effectively dead code. Remove it.
a dead code
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 2/4] software node: remove software_node_exit()
2026-04-02 16:19 ` Andy Shevchenko
@ 2026-04-02 19:46 ` Dmitry Torokhov
0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Torokhov @ 2026-04-02 19:46 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
Danilo Krummrich, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 02, 2026 at 07:19:15PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 02, 2026 at 04:15:03PM +0200, Bartosz Golaszewski wrote:
> > software_node_exit() is an __exitcall() in a built-in compilation unit
> > so effectively dead code. Remove it.
>
> a dead code
"
In technical writing, "dead code" is typically treated as an uncountable
noun, meaning it does not need the article "a" when referring to it as a
category or state.
"
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v5 3/4] driver core: make software nodes available earlier
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
2026-04-02 14:15 ` [PATCH v5 1/4] kernel: ksysfs: initialize kernel_kobj earlier Bartosz Golaszewski
2026-04-02 14:15 ` [PATCH v5 2/4] software node: remove software_node_exit() Bartosz Golaszewski
@ 2026-04-02 14:15 ` Bartosz Golaszewski
2026-04-02 16:20 ` Andy Shevchenko
2026-04-02 14:15 ` [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-02 14:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
linux-omap, Bartosz Golaszewski
Software nodes are currently initialized in a function registered as
a postcore_initcall(). However, some devices may want to register
software nodes earlier than that (or also in a postcore_initcall() where
they're at the merci of the link order). Move the initialization to
driver_init() making swnode available much earlier as well as making
their initialization time deterministic.
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/base/base.h | 1 +
drivers/base/init.c | 1 +
drivers/base/swnode.c | 6 ++----
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index afeda89fd4710c4c5492b5f19134e2aa8e1e581e..30b416588617bbc3fb433654c999c9b533d73752 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -312,6 +312,7 @@ static inline int devtmpfs_create_node(struct device *dev) { return 0; }
static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
#endif
+void software_node_init(void);
void software_node_notify(struct device *dev);
void software_node_notify_remove(struct device *dev);
diff --git a/drivers/base/init.c b/drivers/base/init.c
index 9d2b06d65dfc6bf8759f6c232e2d3f753da139ac..af8014416c2460fac91b08ce919c082bf961fcce 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -34,6 +34,7 @@ void __init driver_init(void)
*/
faux_bus_init();
of_core_init();
+ software_node_init();
platform_bus_init();
auxiliary_bus_init();
memory_dev_init();
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 26cbe1c2a2e043a2315764085207561069c23ccd..a80575bf598b509eb1469cae8a09c601726ce0c8 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -1127,11 +1127,9 @@ void software_node_notify_remove(struct device *dev)
}
}
-static int __init software_node_init(void)
+void __init software_node_init(void)
{
swnode_kset = kset_create_and_add("software_nodes", NULL, kernel_kobj);
if (!swnode_kset)
- return -ENOMEM;
- return 0;
+ pr_err("failed to register software nodes\n");
}
-postcore_initcall(software_node_init);
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v5 3/4] driver core: make software nodes available earlier
2026-04-02 14:15 ` [PATCH v5 3/4] driver core: make software nodes available earlier Bartosz Golaszewski
@ 2026-04-02 16:20 ` Andy Shevchenko
0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2026-04-02 16:20 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 02, 2026 at 04:15:04PM +0200, Bartosz Golaszewski wrote:
> Software nodes are currently initialized in a function registered as
> a postcore_initcall(). However, some devices may want to register
> software nodes earlier than that (or also in a postcore_initcall() where
> they're at the merci of the link order). Move the initialization to
> driver_init() making swnode available much earlier as well as making
> their initialization time deterministic.
Okay, if people want this, why not.
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
` (2 preceding siblings ...)
2026-04-02 14:15 ` [PATCH v5 3/4] driver core: make software nodes available earlier Bartosz Golaszewski
@ 2026-04-02 14:15 ` Bartosz Golaszewski
2026-04-02 16:23 ` Andy Shevchenko
2026-04-02 17:32 ` Dmitry Torokhov
2026-04-02 16:29 ` [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for " Danilo Krummrich
2026-04-04 13:47 ` (subset) " Danilo Krummrich
5 siblings, 2 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-02 14:15 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
linux-omap, Bartosz Golaszewski
Currently the board file for Nokia 770 creates dummy software nodes not
attached in any way to the actual GPIO controller devices and uses the
fact that GPIOLIB matching swnode's name to the GPIO chip's label during
software node lookup. This behavior is wrong and we want to remove it.
To that end, we need to first convert all existing users to creating
actual fwnode links.
Create real software nodes for GPIO controllers on OMAP16xx and
reference them from the software nodes in the nokia board file.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/mach-omap1/board-nokia770.c | 30 +++++-------------------------
arch/arm/mach-omap1/common.h | 3 +++
arch/arm/mach-omap1/gpio16xx.c | 28 +++++++++++++++++++++++++++-
3 files changed, 35 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index a5bf5554800fe17b430e84ae421ffa8da2bb11a0..46f817f6316b70ff37bb9dfde86c675fd692999b 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -36,25 +36,6 @@
#include "clock.h"
#include "mmc.h"
-static const struct software_node nokia770_mpuio_gpiochip_node = {
- .name = "mpuio",
-};
-
-static const struct software_node nokia770_gpiochip1_node = {
- .name = "gpio-0-15",
-};
-
-static const struct software_node nokia770_gpiochip2_node = {
- .name = "gpio-16-31",
-};
-
-static const struct software_node *nokia770_gpiochip_nodes[] = {
- &nokia770_mpuio_gpiochip_node,
- &nokia770_gpiochip1_node,
- &nokia770_gpiochip2_node,
- NULL
-};
-
#define ADS7846_PENDOWN_GPIO 15
static const unsigned int nokia770_keymap[] = {
@@ -112,7 +93,7 @@ static const struct omap_lcd_config nokia770_lcd_config __initconst = {
};
static const struct property_entry nokia770_mipid_props[] = {
- PROPERTY_ENTRY_GPIO("reset-gpios", &nokia770_gpiochip1_node,
+ PROPERTY_ENTRY_GPIO("reset-gpios", &omap16xx_gpio1_swnode,
13, GPIO_ACTIVE_LOW),
{ }
};
@@ -138,7 +119,7 @@ static const struct property_entry nokia770_ads7846_props[] = {
PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180),
PROPERTY_ENTRY_U16("ti,debounce-tol", 3),
PROPERTY_ENTRY_U16("ti,debounce-rep", 1),
- PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node,
+ PROPERTY_ENTRY_GPIO("pendown-gpios", &omap16xx_gpio1_swnode,
ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW),
{ }
};
@@ -225,9 +206,9 @@ static inline void nokia770_mmc_init(void)
#if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)
static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = {
- SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 9, 0),
- SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 10, 0),
- SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 11, 0),
+ SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 9, 0),
+ SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 10, 0),
+ SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 11, 0),
};
static const struct property_entry nokia770_cbus_props[] = {
@@ -318,7 +299,6 @@ static void __init omap_nokia770_init(void)
/* Unmask SleepX signal */
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
- software_node_register_node_group(nokia770_gpiochip_nodes);
platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
gpiod_add_lookup_table(&nokia770_irq_gpio_table);
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index 7a7c3d9eb84a06c18fbc70e7c94a161b487cd002..c0f6e231fdb4422c5d2c1aa3e33dd6dd99d2710e 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -35,6 +35,9 @@
#include "soc.h"
#include "i2c.h"
+extern const struct software_node omap16xx_mpu_gpio_swnode;
+extern const struct software_node omap16xx_gpio1_swnode;
+
#ifdef CONFIG_OMAP_SERIAL_WAKE
int omap_serial_wakeup_init(void);
#else
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 55acec22fef4e73f20935473602ef6cb2f4f379c..e371183e0213912ebfa7edd34ca7e7683869ab12 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -9,6 +9,7 @@
*/
#include <linux/platform_data/gpio-omap.h>
+#include <linux/property.h>
#include <linux/soc/ti/omap1-io.h>
#include "hardware.h"
@@ -55,6 +56,8 @@ static struct omap_gpio_platform_data omap16xx_mpu_gpio_config = {
.regs = &omap16xx_mpuio_regs,
};
+const struct software_node omap16xx_mpu_gpio_swnode = { };
+
static struct platform_device omap16xx_mpu_gpio = {
.name = "omap_gpio",
.id = 0,
@@ -99,6 +102,8 @@ static struct omap_gpio_platform_data omap16xx_gpio1_config = {
.regs = &omap16xx_gpio_regs,
};
+const struct software_node omap16xx_gpio1_swnode = { };
+
static struct platform_device omap16xx_gpio1 = {
.name = "omap_gpio",
.id = 1,
@@ -122,6 +127,8 @@ static struct resource omap16xx_gpio2_resources[] = {
},
};
+static const struct software_node omap16xx_gpio2_swnode = { };
+
static struct omap_gpio_platform_data omap16xx_gpio2_config = {
.bank_width = 16,
.regs = &omap16xx_gpio_regs,
@@ -155,6 +162,8 @@ static struct omap_gpio_platform_data omap16xx_gpio3_config = {
.regs = &omap16xx_gpio_regs,
};
+static const struct software_node omap16xx_gpio3_swnode = { };
+
static struct platform_device omap16xx_gpio3 = {
.name = "omap_gpio",
.id = 3,
@@ -183,6 +192,8 @@ static struct omap_gpio_platform_data omap16xx_gpio4_config = {
.regs = &omap16xx_gpio_regs,
};
+static const struct software_node omap16xx_gpio4_swnode = { };
+
static struct platform_device omap16xx_gpio4 = {
.name = "omap_gpio",
.id = 4,
@@ -201,6 +212,14 @@ static struct platform_device *omap16xx_gpio_dev[] __initdata = {
&omap16xx_gpio4,
};
+static const struct software_node *omap16xx_gpio_swnodes[] __initconst = {
+ &omap16xx_mpu_gpio_swnode,
+ &omap16xx_gpio1_swnode,
+ &omap16xx_gpio2_swnode,
+ &omap16xx_gpio3_swnode,
+ &omap16xx_gpio4_swnode,
+};
+
/*
* omap16xx_gpio_init needs to be done before
* machine_init functions access gpio APIs.
@@ -208,7 +227,7 @@ static struct platform_device *omap16xx_gpio_dev[] __initdata = {
*/
static int __init omap16xx_gpio_init(void)
{
- int i;
+ int i, ret;
void __iomem *base;
struct resource *res;
struct platform_device *pdev;
@@ -244,6 +263,13 @@ static int __init omap16xx_gpio_init(void)
iounmap(base);
platform_device_register(omap16xx_gpio_dev[i]);
+
+ ret = device_add_software_node(&omap16xx_gpio_dev[i]->dev,
+ omap16xx_gpio_swnodes[i]);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to add software node.\n");
+ return ret;
+ }
}
return 0;
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
2026-04-02 14:15 ` [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
@ 2026-04-02 16:23 ` Andy Shevchenko
2026-04-02 17:32 ` Dmitry Torokhov
1 sibling, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2026-04-02 16:23 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 02, 2026 at 04:15:05PM +0200, Bartosz Golaszewski wrote:
> Currently the board file for Nokia 770 creates dummy software nodes not
> attached in any way to the actual GPIO controller devices and uses the
> fact that GPIOLIB matching swnode's name to the GPIO chip's label during
> software node lookup. This behavior is wrong and we want to remove it.
> To that end, we need to first convert all existing users to creating
> actual fwnode links.
>
> Create real software nodes for GPIO controllers on OMAP16xx and
> reference them from the software nodes in the nokia board file.
...
> +static const struct software_node omap16xx_gpio2_swnode = { };
No need to have {} for statically defined variables.
OTOH, if you want to have same style over exported and static,
perhaps it's okay.
> +static const struct software_node omap16xx_gpio3_swnode = { };
> +static const struct software_node omap16xx_gpio4_swnode = { };
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
2026-04-02 14:15 ` [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
2026-04-02 16:23 ` Andy Shevchenko
@ 2026-04-02 17:32 ` Dmitry Torokhov
2026-04-03 7:23 ` Bartosz Golaszewski
1 sibling, 1 reply; 15+ messages in thread
From: Dmitry Torokhov @ 2026-04-02 17:32 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 02, 2026 at 04:15:05PM +0200, Bartosz Golaszewski wrote:
> @@ -244,6 +263,13 @@ static int __init omap16xx_gpio_init(void)
> iounmap(base);
>
> platform_device_register(omap16xx_gpio_dev[i]);
> +
> + ret = device_add_software_node(&omap16xx_gpio_dev[i]->dev,
> + omap16xx_gpio_swnodes[i]);
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to add software node.\n");
> + return ret;
> + }
I think the best and safest way is to convert to using
platform_driver_register_full() and set swnode in the relevant "info"
instance.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
2026-04-02 17:32 ` Dmitry Torokhov
@ 2026-04-03 7:23 ` Bartosz Golaszewski
0 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2026-04-03 7:23 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
Russell King, Kevin Hilman, Arnd Bergmann, driver-core,
linux-kernel, linux-acpi, linux-arm-kernel, linux-omap
On Thu, Apr 2, 2026 at 7:32 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Thu, Apr 02, 2026 at 04:15:05PM +0200, Bartosz Golaszewski wrote:
> > @@ -244,6 +263,13 @@ static int __init omap16xx_gpio_init(void)
> > iounmap(base);
> >
> > platform_device_register(omap16xx_gpio_dev[i]);
> > +
> > + ret = device_add_software_node(&omap16xx_gpio_dev[i]->dev,
> > + omap16xx_gpio_swnodes[i]);
> > + if (ret) {
> > + dev_err(&pdev->dev, "Failed to add software node.\n");
> > + return ret;
> > + }
>
> I think the best and safest way is to convert to using
> platform_driver_register_full() and set swnode in the relevant "info"
> instance.
For sure, that's the plan. I will respin this after v7.1-rc1 with that change.
Bart
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
` (3 preceding siblings ...)
2026-04-02 14:15 ` [PATCH v5 4/4] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
@ 2026-04-02 16:29 ` Danilo Krummrich
2026-04-04 13:47 ` (subset) " Danilo Krummrich
5 siblings, 0 replies; 15+ messages in thread
From: Danilo Krummrich @ 2026-04-02 16:29 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Andy Shevchenko,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu Apr 2, 2026 at 4:15 PM CEST, Bartosz Golaszewski wrote:
> Bartosz Golaszewski (4):
> kernel: ksysfs: initialize kernel_kobj earlier
> software node: remove software_node_exit()
> driver core: make software nodes available earlier
Looks good to me now; I will give it a few more days on the list and then pull
it in for v7.1-rc1 if no one else raises concerns.
> ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: (subset) [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770
2026-04-02 14:15 [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
` (4 preceding siblings ...)
2026-04-02 16:29 ` [PATCH v5 0/4] ARM: omap1: use real firmware node lookup for " Danilo Krummrich
@ 2026-04-04 13:47 ` Danilo Krummrich
5 siblings, 0 replies; 15+ messages in thread
From: Danilo Krummrich @ 2026-04-04 13:47 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Andy Shevchenko,
Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
linux-acpi, linux-arm-kernel, linux-omap
On Thu Apr 2, 2026 at 4:15 PM CEST, Bartosz Golaszewski wrote:
Applied to driver-core-testing, thanks!
> Bartosz Golaszewski (4):
> kernel: ksysfs: initialize kernel_kobj earlier
> software node: remove software_node_exit()
> driver core: make software nodes available earlier
[ Fix typo in the commit message: "s/merci/mercy/". - Danilo ]
^ permalink raw reply [flat|nested] 15+ messages in thread