]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: hdmi: Check the device state in prepare()
authorMaxime Ripard <maxime@cerno.tech>
Mon, 25 Oct 2021 14:11:11 +0000 (16:11 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 5 Nov 2021 11:53:28 +0000 (12:53 +0100)
commitc1c032d1be887d838f6d8d2de765852d17fe6ec1
tree58b1bd490f6af3d3f27424ae759219e32dd199a9
parent4cbc41bbd5e7bebd15efb93a7785cfcb2eb3b2d5
drm/vc4: hdmi: Check the device state in prepare()

Even though we already check that the encoder->crtc pointer is there
during in startup(), which is part of the open() path in ASoC, nothing
guarantees that our encoder state won't change between the time when we
open the device and the time we prepare it.

Move the sanity checks we do in startup() to a helper and call it from
prepare().

Link: https://lore.kernel.org/r/20211025141113.702757-8-maxime@cerno.tech
Fixes: ff203ada4d65 ("drm/vc4: hdmi: Register HDMI codec")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c