From 86a3ae587980f857284a11b86ef345f47298aade Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 15 Jan 2018 11:11:13 +0300 Subject: drm/sun4i: Fix error code in sun4i_tcon_bind() We accidentally passed the wrong variable to PTR_ERR(). Fixes: a0c1214e4764 ("drm/sun4i: Add LVDS support") Signed-off-by: Dan Carpenter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180115081113.wlam5wkmdynisf4r@mwanda --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index a897f82d9e66..1e3e8ebd9ed3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -902,7 +902,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, has_lvds_alt = false; } else { dev_err(dev, "Couldn't get the LVDS PLL\n"); - return PTR_ERR(tcon->lvds_rst); + return PTR_ERR(tcon->lvds_pll); } } else { has_lvds_alt = true; -- cgit v1.2.3 From a0d605372a279d71abd29ed985b9a51e66e12170 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 10 Jan 2018 16:59:41 +0100 Subject: drm/panel: lvds: Handle the optional regulator case properly The devm_regulator_get_optional function, unlike it was assumed in the commit a1c55bccf600 ("drm/panel: lvds: Add support for the power-supply property"), is actually returning an error pointer with -ENODEV instead of NULL when there's no regulator to find. Make sure we handle that case properly. Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Fixes: a1c55bccf600 ("drm/panel: lvds: Add support for the power-supply property") Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180110155941.16109-1-maxime.ripard@free-electrons.com --- drivers/gpu/drm/panel/panel-lvds.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 57e38a9e7ab4..b5e3994f0aa8 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -215,8 +215,15 @@ static int panel_lvds_probe(struct platform_device *pdev) lvds->supply = devm_regulator_get_optional(lvds->dev, "power"); if (IS_ERR(lvds->supply)) { ret = PTR_ERR(lvds->supply); - dev_err(lvds->dev, "failed to request regulator: %d\n", ret); - return ret; + + if (ret != -ENODEV) { + if (ret != -EPROBE_DEFER) + dev_err(lvds->dev, "failed to request regulator: %d\n", + ret); + return ret; + } + + lvds->supply = NULL; } /* Get GPIOs and backlight controller. */ -- cgit v1.2.3 From 341a0ffceaa44660c43d219a3b2569ebbd7d3ad1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 17 Jan 2018 09:10:32 +0100 Subject: drm: Fix PANEL_ORIENTATION_QUIRKS breaking the Kconfig DRM menuconfig All Kconfig menu menu entries should have a depends on MENU_OPTION, the menu stops after the first Kconfig entry without this depends on. Since the PANEL_ORIENTATION_QUIRKS option is also used outside of DRM, it deliberately does not have a depends on DRM, but this causes all items after it to show as separate items rather then under the DRM menuconfig. This commit moves PANEL_ORIENTATION_QUIRKS to the end of the drm Kconfig file, grouping it with DRM_LIB_RANDOM which also does not depend on DRM, fixing the DRM menuconfig. Fixes: 404d1a3edc38 ("drm: Add panel orientation quirks, v6.") Cc: Chris Wilson Reported-by: Chris Wilson Reviewed-by: Daniel Vetter Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20180117081032.6411-1-hdegoede@redhat.com --- drivers/gpu/drm/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index d853989848d6..fbd37be9e882 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -27,10 +27,6 @@ config DRM_MIPI_DSI bool depends on DRM -# Separate option because drm_panel_orientation_quirks.c is shared with fbdev -config DRM_PANEL_ORIENTATION_QUIRKS - tristate - config DRM_DP_AUX_CHARDEV bool "DRM DP AUX Interface" depends on DRM @@ -367,6 +363,10 @@ config DRM_SAVAGE endif # DRM_LEGACY +# Separate option because drm_panel_orientation_quirks.c is shared with fbdev +config DRM_PANEL_ORIENTATION_QUIRKS + tristate + config DRM_LIB_RANDOM bool default n -- cgit v1.2.3