Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The patch missed replacing `device_set_of_node_from_dev()` with the new `platform_device_set_of_node_from_dev()` wrapper for four dynamically allocated platform devices in the `musb` subsystem. Because the final patch in this series modifies `platform_device_release()` to only drop the `fwnode` reference instead of the `of_node` reference, these four un-migrated drivers will never have their `fwnode` field populated and will leak their `of_node` reference upon device destruction. --
commit 38644321565357d4bf1b4cbb11a9e179abf72efc Author: Bartosz Golaszewski <[email protected]> usb: musb: use platform_device_set_of_node_from_dev() Ahead of reworking the reference counting logic for platform devices, encapsulate the assignment of the OF node from another device for dynamically allocated platform devices with the provided helper. > diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c > index df56c972986f7..c770ba576f05b 100644 > --- a/drivers/usb/musb/jz4740.c > +++ b/drivers/usb/musb/jz4740.c > @@ -273,7 +273,7 @@ static int jz4740_probe(struct platform_device *pdev) > musb->dev.parent = dev; > musb->dev.dma_mask = &musb->dev.coherent_dma_mask; > musb->dev.coherent_dma_mask = DMA_BIT_MASK(32); > - device_set_of_node_from_dev(&musb->dev, dev); > + platform_device_set_of_node_from_dev(musb, dev); [Severity: Medium] Will this miss other dynamically allocated platform devices in the musb subsystem? Because the final patch in this series modifies platform_device_release() to only drop the fwnode reference instead of the of_node reference, wouldn't these remaining un-migrated drivers never have their fwnode field populated? This could cause an of_node reference leak upon device destruction (e.g., via platform_device_put() on probe failure or driver unbinding). If these devices are instantiated via dynamic Device Tree overlays, the leaked reference will prevent the overlay from being safely unloaded. The following files appear to have missed the migration: drivers/usb/musb/mpfs.c:mpfs_probe() device_set_of_node_from_dev(&musb_pdev->dev, dev); drivers/usb/musb/musb_dsps.c:dsps_create_musb_pdev() device_set_of_node_from_dev(&musb->dev, &parent->dev); drivers/usb/musb/omap2430.c:omap2430_probe() device_set_of_node_from_dev(&musb->dev, &pdev->dev); drivers/usb/musb/ux500.c:ux500_probe() device_set_of_node_from_dev(&musb->dev, &pdev->dev); -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=18
