Re: [PATCH] dmaengine: jz4780: handle clock enable failures

From: Markus Elfring

Date: Sun Nov 29 2026 - 14:10:40 EST


> jz4780_dma_probe() ignores the result of clk_prepare_enable() and
> continues to configure controller registers, request resources, and
> register the DMA controller. A parent-clock failure can therefore publish
> a controller without a successful clock activation. Later probe cleanup
> can also attempt to disable a clock that was never enabled.
>
> Propagate the activation error before touching the controller.

How do you think about to reuse the function “devm_clk_get_enabled”?
https://elixir.bootlin.com/linux/v7.4-rc2/source/include/linux/clk.h#L615-L632
https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/dma/dma-jz4780.c#L898-L905

Regards,
Markus