drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL
authorBoris Brezillon <boris.brezillon@bootlin.com>
Wed, 9 May 2018 13:00:39 +0000 (15:00 +0200)
committerThierry Reding <treding@nvidia.com>
Tue, 10 Jul 2018 15:59:05 +0000 (17:59 +0200)
commit5fa8e4a22182df8ea39adeba4bd518506e26a96d
tree4b9a3df577632f7c2165ea86d4d98f2cb5018266
parent0ca0c827efdf248dfb4bbd4b9066acb6337e07ac
drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL

Right now, the DRM panel logic returns NULL when a panel pointing to
the passed OF node is not present in the list of registered panels.

Most drivers interpret this NULL value as -EPROBE_DEFER, but we are
about to modify the semantic of of_drm_find_panel() and let the
framework return -ENODEV when the device node we're pointing to has
a status property that is not equal to "okay" or "ok".

Let's first patch the of_drm_find_panel() implementation to return
ERR_PTR(-EPROBE_DEFER) instead of NULL and patch all callers to replace
the '!panel' check by an 'IS_ERR(panel)' one.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-2-boris.brezillon@bootlin.com
18 files changed:
drivers/gpu/drm/bridge/cdns-dsi.c
drivers/gpu/drm/bridge/lvds-encoder.c
drivers/gpu/drm/drm_of.c
drivers/gpu/drm/drm_panel.c
drivers/gpu/drm/exynos/exynos_dp.c
drivers/gpu/drm/exynos/exynos_drm_dpi.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c
drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c
drivers/gpu/drm/msm/dsi/dsi_host.c
drivers/gpu/drm/rcar-du/rcar_lvds.c
drivers/gpu/drm/rockchip/dw-mipi-dsi.c
drivers/gpu/drm/sti/sti_dvo.c
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
drivers/gpu/drm/tegra/dsi.c
drivers/gpu/drm/tegra/output.c
include/drm/drm_panel.h