Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: core: Restore sysfs fwnode information

The change that restores sysfs fwnode information does it only for OF cases.
Update the fix to cover all possible types of fwnodes.

Fixes: d36f0e9a0002 ("serial: core: restore of_node information in sysfs")
Cc: stable <stable@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251127163650.2942075-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
24ec03cc 8f0b4cce

+6 -4
+6 -4
drivers/tty/serial/serial_base_bus.c
··· 13 13 #include <linux/device.h> 14 14 #include <linux/idr.h> 15 15 #include <linux/module.h> 16 - #include <linux/of.h> 16 + #include <linux/property.h> 17 17 #include <linux/serial_core.h> 18 18 #include <linux/slab.h> 19 19 #include <linux/spinlock.h> ··· 60 60 driver_unregister(driver); 61 61 } 62 62 63 + /* On failure the caller must put device @dev with put_device() */ 63 64 static int serial_base_device_init(struct uart_port *port, 64 65 struct device *dev, 65 66 struct device *parent_dev, ··· 74 73 dev->parent = parent_dev; 75 74 dev->bus = &serial_base_bus_type; 76 75 dev->release = release; 77 - device_set_of_node_from_dev(dev, parent_dev); 76 + 77 + device_set_node(dev, fwnode_handle_get(dev_fwnode(parent_dev))); 78 78 79 79 if (!serial_base_initialized) { 80 80 dev_dbg(port->dev, "uart_add_one_port() called before arch_initcall()?\n"); ··· 96 94 { 97 95 struct serial_ctrl_device *ctrl_dev = to_serial_base_ctrl_device(dev); 98 96 99 - of_node_put(dev->of_node); 97 + fwnode_handle_put(dev_fwnode(dev)); 100 98 kfree(ctrl_dev); 101 99 } 102 100 ··· 144 142 { 145 143 struct serial_port_device *port_dev = to_serial_base_port_device(dev); 146 144 147 - of_node_put(dev->of_node); 145 + fwnode_handle_put(dev_fwnode(dev)); 148 146 kfree(port_dev); 149 147 } 150 148