drm/vc4: hdmi: Remove redundant variables
authorMaxime Ripard <maxime@cerno.tech>
Wed, 7 Jul 2021 09:36:31 +0000 (11:36 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 29 Jul 2021 08:41:16 +0000 (10:41 +0200)
commitf143778d90829ac37e6a481772dc0f26e3071de7
tree48829b2ae55d9bd6bfa7c981613430ce160804c0
parentd793b8f732d6acbc6390be7342fb2e92b069dc7f
drm/vc4: hdmi: Remove redundant variables

The vc4_hdmi_audio_prepare function and the functions it's calling have
in several occurences multiple dereferences of either the sample rate or
the number of channels.

It turns out that these variables are also passed through the hdmi codec
parameters structure. Convert all the users to use this structure, and
if it's used multiple times use a variable to store it instead of
dereferencing it every time.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210707093632.1468127-1-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h