diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-07-06 14:44:14 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-10 16:07:08 +0200 |
| commit | 714cfe9e143feb2136e9dc331c43e2453b3c3d4d (patch) | |
| tree | 4681ae4e65d2ce73380ca8abfbaf93959cddfec7 /include | |
| parent | bd0abfe6b013aeb2a1aebc5fbc7ceeb50355bda3 (diff) | |
| download | linux-stable-714cfe9e143feb2136e9dc331c43e2453b3c3d4d.tar.gz linux-stable-714cfe9e143feb2136e9dc331c43e2453b3c3d4d.zip | |
driver core: platform: provide platform_device_set_of_node()
Encapsulate the reference counting logic for OF nodes assigned to
platform devices created with platform_device_alloc() in a helper
function. Make the kerneldoc state that this is the proper interface for
assigning OF nodes to dynamically allocated platform devices. This will
allow us to switch to counting the references of the device's firmware
nodes, not only the OF nodes.
Reviewed-by: Manuel Ebner <manuelebner@mailbox.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260706-pdev-fwnode-ref-v3-2-1ff028e33779@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/platform_device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 26e6a43358e2..870d168aeff8 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -19,6 +19,7 @@ struct irq_affinity; struct mfd_cell; struct property_entry; struct platform_device_id; +struct device_node; struct platform_device { const char *name; @@ -262,6 +263,8 @@ extern int platform_device_add_resources(struct platform_device *pdev, unsigned int num); extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); +void platform_device_set_of_node(struct platform_device *pdev, + struct device_node *np); extern int platform_device_add(struct platform_device *pdev); extern void platform_device_del(struct platform_device *pdev); extern void platform_device_put(struct platform_device *pdev); |
