]> git.baikalelectronics.ru Git - kernel.git/commit
drm/sun4i: dsi: Use NULL to signify "no panel"
authorSamuel Holland <samuel@sholland.org>
Tue, 11 Feb 2020 07:28:56 +0000 (01:28 -0600)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 14 Feb 2020 15:20:24 +0000 (16:20 +0100)
commitcbedfc99a85926fe5f03872b9ae0440a9f519f85
treee5baccd30c6151b7428c58f4ccf2bcb07013c166
parent1ca3df594a76de80b3ba44e4f49c72d977b51a52
drm/sun4i: dsi: Use NULL to signify "no panel"

The continued use of an ERR_PTR to signify "no panel" outside of
sun6i_dsi_attach is confusing because it is a double negative. Because
the connector always reports itself as connected, there is also the
possibility of sending an ERR_PTR to drm_panel_get_modes(), which would
crash.

Solve both of these by only storing the panel pointer if it is valid.

Fixes: 19c919dabc20 ("drm/sun4i: Add Allwinner A31 MIPI-DSI controller support")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200211072858.30784-2-samuel@sholland.org
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c