drm/msm/dsi: properly handle the case of empty OPP table in dsi_mgr_bridge_mode_valid
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 24 Jan 2023 20:36:00 +0000 (22:36 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 26 Jan 2023 18:51:32 +0000 (20:51 +0200)
commit2ec56b232b9775b4814c207ed6da9f065b29711c
tree9486c9badeb66fb609c8bfe2ffbf7d6070b9c038
parenta7efe60e36b9c0e966d7f82ac90a89b591d984e9
drm/msm/dsi: properly handle the case of empty OPP table in dsi_mgr_bridge_mode_valid

It was left unnoticed during the review that even if there is no OPP
table in device tree, one will be created by a call to the function
devm_pm_opp_set_clkname(). This leads to dsi_mgr_bridge_mode_valid()
rejecting all modes if DT contains no OPP table for the DSI host.

Rework dsi_mgr_bridge_mode_valid() to handle this case by actually
checking that the table is populated with frequency entries before
returning an error.

Fixes: 8328041b8c82 ("drm/msm/dsi: implement opp table based check for dsi_mgr_bridge_mode_valid()")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/520076/
Link: https://lore.kernel.org/r/20230124203600.3488766-1-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dsi/dsi_manager.c