]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
software node: Also support referencing non-constant software nodes
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 19 Dec 2025 08:36:38 +0000 (10:36 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 22 Dec 2025 12:32:22 +0000 (13:32 +0100)
Fwnode references are be implemented differently if referenced node is a
software node. _Generic() is used to differentiate between the two cases
but only const software nodes were present in the selection. Also add
non-const software nodes.

Reported-by: Kenneth Crudup <kenny@panix.com>
Closes: https://lore.kernel.org/all/af773b82-bef2-4209-baaf-526d4661b7fc@panix.com/
Fixes: d7cdbbc93c56 ("software node: allow referencing firmware nodes")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-By: Kenneth R. Crudup <kenny@panix.com>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Link: https://patch.msgid.link/20251219083638.2454138-1-sakari.ailus@linux.intel.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
include/linux/property.h

index 272bfbdea7bf4ab1143159fa49fc29dcdde0ef9d..e30ef23a9af3396455d5bb19bb6d41089d81d77f 100644 (file)
@@ -371,6 +371,7 @@ struct software_node_ref_args {
 (const struct software_node_ref_args) {                                \
        .swnode = _Generic(_ref_,                               \
                           const struct software_node *: _ref_, \
+                          struct software_node *: _ref_,       \
                           default: NULL),                      \
        .fwnode = _Generic(_ref_,                               \
                           struct fwnode_handle *: _ref_,       \