bianbu-linux-6.6/drivers/gpu/drm/sun4i
XuDong Liu 123ee07ba5
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: 9026e0d122 ("drm: Add Allwinner A10 Display Engine support")
Fixes: b14e945bda ("drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init")
Fixes: 8e92404725 ("drm/sun4i: support TCONs without channel 1")
Fixes: 34d698f6e3 ("drm/sun4i: Add has_channel_0 TCON quirk")
Signed-off-by: XuDong Liu <m202071377@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230430112347.4689-1-m202071377@hust.edu.cn
2023-05-11 09:30:14 +02:00
..
Kconfig drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
Makefile drm: sun4i: rename sun4i_dotclock to sun4i_tcon_dclk 2023-05-10 16:03:10 +02:00
sun4i_backend.c drm: Use of_property_present() for testing DT property presence 2023-03-28 14:55:33 -05:00
sun4i_backend.h
sun4i_crtc.c sun4i/drm: engine: Add mode_set callback 2022-04-26 14:24:16 +02:00
sun4i_crtc.h
sun4i_drv.c drm/aperture: Remove primary argument 2023-04-16 14:17:41 +02:00
sun4i_drv.h
sun4i_framebuffer.c drm: Drop drm_blend.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
sun4i_framebuffer.h
sun4i_frontend.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
sun4i_frontend.h
sun4i_hdmi.h drm/sun4i: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi 2022-04-22 11:51:52 +02:00
sun4i_hdmi_ddc_clk.c
sun4i_hdmi_enc.c drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
sun4i_hdmi_i2c.c drm/sun4i: hdmi: Use more portable I/O helpers 2022-04-26 14:23:47 +02:00
sun4i_hdmi_tmds_clk.c
sun4i_layer.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
sun4i_layer.h
sun4i_lvds.c
sun4i_lvds.h
sun4i_rgb.c
sun4i_rgb.h
sun4i_tcon.c drm: sun4i_tcon: use devm_clk_get_enabled in sun4i_tcon_init_clocks 2023-05-11 09:30:14 +02:00
sun4i_tcon.h drm: Remove linux/fb.h from drm_crtc.h 2022-07-05 21:14:02 +03:00
sun4i_tcon_dclk.c drm: sun4i: rename sun4i_dotclock to sun4i_tcon_dclk 2023-05-10 16:03:10 +02:00
sun4i_tcon_dclk.h drm: sun4i: rename sun4i_dotclock to sun4i_tcon_dclk 2023-05-10 16:03:10 +02:00
sun4i_tv.c drm/sun4i: tv: Convert to the new TV mode property 2022-11-24 12:42:41 +01:00
sun6i_drc.c
sun6i_mipi_dsi.c drm/sun4i: dsi: Add the A100 variant 2022-11-07 14:09:54 +01:00
sun6i_mipi_dsi.h drm/sun4i: dsi: Add a variant structure 2022-11-07 14:09:54 +01:00
sun8i_csc.c drm/sun4i: csc: Add support for the new MMIO layout 2022-04-26 14:25:15 +02:00
sun8i_csc.h drm/sun4i: csc: Add support for the new MMIO layout 2022-04-26 14:25:15 +02:00
sun8i_dw_hdmi.c drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
sun8i_dw_hdmi.h Linux 5.19-rc6 2022-07-13 10:54:56 +10:00
sun8i_hdmi_phy.c drm/sun4i: sun8i-hdmi-phy: Group PHY ops functions by generation 2022-06-16 09:27:46 +02:00
sun8i_hdmi_phy_clk.c
sun8i_mixer.c drm: Use of_property_present() for testing DT property presence 2023-03-28 14:55:33 -05:00
sun8i_mixer.h drm/sun4i: csc: Add support for the new MMIO layout 2022-04-26 14:25:15 +02:00
sun8i_tcon_top.c drm/sun4i: Add support for D1 TCON TOP 2022-04-26 14:25:43 +02:00
sun8i_tcon_top.h
sun8i_ui_layer.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
sun8i_ui_layer.h
sun8i_ui_scaler.c
sun8i_ui_scaler.h
sun8i_vi_layer.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
sun8i_vi_layer.h
sun8i_vi_scaler.c
sun8i_vi_scaler.h
sunxi_engine.h sun4i/drm: engine: Add mode_set callback 2022-04-26 14:24:16 +02:00