Skip to content

Commit 5eb63e9

Browse files
jhovoldkhilman
authored andcommitted
bus: omap-ocp2scp: fix OF populate on driver rebind
Since commit c6e126d ("of: Keep track of populated platform devices") child devices will not be created by of_platform_populate() if the devices had previously been deregistered individually so that the OF_POPULATED flag is still set in the corresponding OF nodes. Switch to using of_platform_depopulate() instead of open coding so that the child devices are created if the driver is rebound. Fixes: c6e126d ("of: Keep track of populated platform devices") Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20251219110119.23507-1-johan@kernel.org Signed-off-by: Kevin Hilman <khilman@baylibre.com>
1 parent 8f0b4cc commit 5eb63e9

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

drivers/bus/omap-ocp2scp.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
#define OCP2SCP_TIMING 0x18
1818
#define SYNC2_MASK 0xf
1919

20-
static int ocp2scp_remove_devices(struct device *dev, void *c)
21-
{
22-
struct platform_device *pdev = to_platform_device(dev);
23-
24-
platform_device_unregister(pdev);
25-
26-
return 0;
27-
}
28-
2920
static int omap_ocp2scp_probe(struct platform_device *pdev)
3021
{
3122
int ret;
@@ -79,15 +70,15 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
7970
pm_runtime_disable(&pdev->dev);
8071

8172
err0:
82-
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
73+
of_platform_depopulate(&pdev->dev);
8374

8475
return ret;
8576
}
8677

8778
static void omap_ocp2scp_remove(struct platform_device *pdev)
8879
{
8980
pm_runtime_disable(&pdev->dev);
90-
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
81+
of_platform_depopulate(&pdev->dev);
9182
}
9283

9384
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)