[PATCH] mfd: stm32-timers: depopulate child devices on populate failure
Pengpeng Hou
pengpeng at iscas.ac.cn
Thu Jul 2 23:50:16 PDT 2026
Hi Lee,
Thanks for taking a look.
I checked devm_of_platform_populate(), but I don't think it covers this
particular failure path on its own.
devm_of_platform_populate() only installs the devres cleanup after
of_platform_populate() has returned success. If of_platform_populate()
returns an error after creating some earlier children, the helper just
frees its devres record and those partial children are not depopulated.
For stm32-timers, I think we still need the explicit ordering used by
remove: depopulate children before stm32_timers_dma_remove(). The child
drivers get the parent drvdata, and the PWM child can call the parent
stm32_timers_dma_burst_read() helper, so releasing the parent DMA
channels while partially-created children remain would keep the same
ordering problem the remove path avoids.
I agree the inline unwind is not the clearest form. I can send a v2
using a normal goto unwind label and a short comment explaining the
partial-populate case, unless you prefer a different shape.
Thanks,
Pengpeng
More information about the linux-arm-kernel
mailing list