Make sure to depopulate the child devices in case of late probe
failures to avoid leaking the corresponding resources.
Fixes: fd60ac585607 ("greybus: arche-platform: Fix boot, poweroff and fw_flashing seq with APBs")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251219105928.23329-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arche_pdata->pm_notifier.notifier_call = arche_platform_pm_notifier;
ret = register_pm_notifier(&arche_pdata->pm_notifier);
-
if (ret) {
dev_err(dev, "failed to register pm notifier %d\n", ret);
- goto err_device_remove;
+ goto err_depopulate;
}
/* Explicitly power off if requested */
err_unregister_pm_notifier:
unregister_pm_notifier(&arche_pdata->pm_notifier);
+err_depopulate:
+ of_platform_depopulate(dev);
err_device_remove:
device_remove_file(&pdev->dev, &dev_attr_state);
return ret;