Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 7f4cedd8 authored by Giulio Benetti's avatar Giulio Benetti Committed by Maxime Ripard
Browse files

drm/sun4i: tcon: fix check of tcon->panel null pointer



Since tcon->panel is a pointer returned by of_drm_find_panel() need to
check if it is not NULL, hence a valid pointer.
IS_ERR() instead checks return error values, not NULL pointers.

Substitute "if (!IS_ERR(tcon->panel))" with "if (tcon->panel)".

Signed-off-by: default avatarGiulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181005215951.99003-1-giulio.benetti@micronovasrl.com
parent 65102238
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static void sun4i_lvds_encoder_enable(struct drm_encoder *encoder)

	DRM_DEBUG_DRIVER("Enabling LVDS output\n");

	if (!IS_ERR(tcon->panel)) {
	if (tcon->panel) {
		drm_panel_prepare(tcon->panel);
		drm_panel_enable(tcon->panel);
	}
@@ -88,7 +88,7 @@ static void sun4i_lvds_encoder_disable(struct drm_encoder *encoder)

	DRM_DEBUG_DRIVER("Disabling LVDS output\n");

	if (!IS_ERR(tcon->panel)) {
	if (tcon->panel) {
		drm_panel_disable(tcon->panel);
		drm_panel_unprepare(tcon->panel);
	}
+2 −2
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)

	DRM_DEBUG_DRIVER("Enabling RGB output\n");

	if (!IS_ERR(tcon->panel)) {
	if (tcon->panel) {
		drm_panel_prepare(tcon->panel);
		drm_panel_enable(tcon->panel);
	}
@@ -148,7 +148,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)

	DRM_DEBUG_DRIVER("Disabling RGB output\n");

	if (!IS_ERR(tcon->panel)) {
	if (tcon->panel) {
		drm_panel_disable(tcon->panel);
		drm_panel_unprepare(tcon->panel);
	}
+1 −1
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
	 * Following code is a way to avoid quirks all around TCON
	 * and DOTCLOCK drivers.
	 */
	if (!IS_ERR(tcon->panel)) {
	if (tcon->panel) {
		struct drm_panel *panel = tcon->panel;
		struct drm_connector *connector = panel->connector;
		struct drm_display_info display_info = connector->display_info;