Skip to content
Snippets Groups Projects
Unverified Commit 123ee07b authored by XuDong Liu's avatar XuDong Liu Committed by Maxime Ripard
Browse files

drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks`


Smatch reports:
drivers/gpu/drm/sun4i/sun4i_tcon.c:805 sun4i_tcon_init_clocks() warn:
'tcon->clk' from clk_prepare_enable() not released on lines: 792,801.

In the function sun4i_tcon_init_clocks(), tcon->clk and tcon->sclk0 are
not disabled in the error handling, which affects the release of
these variable. Although sun4i_tcon_bind(), which calls
sun4i_tcon_init_clocks(), use sun4i_tcon_free_clocks to disable the
variables mentioned, but the error handling branch of
sun4i_tcon_init_clocks() ignores the required disable process.

To fix this issue, use the devm_clk_get_enabled to automatically
balance enable and disabled calls. As original implementation use
sun4i_tcon_free_clocks() to disable clk explicitly, we delete the
related calls and error handling that are no longer needed.

Fixes: 9026e0d1 ("drm: Add Allwinner A10 Display Engine support")
Fixes: b14e945b ("drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init")
Fixes: 8e924047 ("drm/sun4i: support TCONs without channel 1")
Fixes: 34d698f6 ("drm/sun4i: Add has_channel_0 TCON quirk")
Signed-off-by: default avatarXuDong Liu <m202071377@hust.edu.cn>
Reviewed-by: default avatarDongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230430112347.4689-1-m202071377@hust.edu.cn
parent 4795c787
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment