On Thu, Apr 23, 2026 at 02:12:02PM +0200, Bartosz Golaszewski wrote:
> If we pass a software node to a newly created device using struct
> platform_device_info, it will not be removed when the device is
> released. This may happen when a module creating the device is removed
> or on failure in platform_device_add().
> 
> When we try to reuse that software node in a subsequent call to
> platform_device_register_full(), it will fails with -EBUSY. Add the
> missing call to device_remove_software_node() in release path.
> 
> Make sure that we still function correctly if a software node is used as
> the primary firmware node.

...

> +     device_remove_software_node(dev);

>       of_node_put(pa->pdev.dev.of_node);

Can we rather replace of_* get/put with the fwnode_* get/put and make a
conditional here?

        if (is_software_node(...))
                device_remove...
        else
                fwnode_handle_put().

(or something like this)

And IIRC the above pattern has been already seen somewhere else. But I can't
point to it, just some weak memories of seeing that already.


-- 
With Best Regards,
Andy Shevchenko



Reply via email to