devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails
Date: Tue, 17 May 2016 23:56:06 +0800	[thread overview]
Message-ID: <1463500571-28970-2-git-send-email-wens@csie.org> (raw)
In-Reply-To: <1463500571-28970-1-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>

sun4i_rgb_init() can fail, which results in TCON failing to bind.
In this case we need to do cleanup, specificly unregistering the
dotclock, which is regmap based, and the regmap is registered as
part of the sun4i_tcon_bind().

Failing to do so results in a NULL pointer reference when the CCF
tries to turn off unused clocks.

Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output")
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 9f19b0e08560..dea673275356 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -490,7 +490,11 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
 		return 0;
 	}
 
-	return sun4i_rgb_init(drm);
+	ret = sun4i_rgb_init(drm);
+	if (ret < 0)
+		goto err_free_clocks;
+
+	return 0;
 
 err_free_clocks:
 	sun4i_tcon_free_clocks(tcon);
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-05-17 15:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 15:56 [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals Chen-Yu Tsai
2016-05-17 15:56 ` [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default Chen-Yu Tsai
     [not found]   ` <1463500571-28970-3-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>
2016-05-25 12:39     ` Maxime Ripard
2016-05-17 15:56 ` [PATCH 4/6] ARM: dts: sun5i: q8-common: Enable USB power supply Chen-Yu Tsai
2016-05-25 12:41   ` Maxime Ripard
2016-05-17 15:56 ` [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec Chen-Yu Tsai
2016-05-25 12:43   ` Maxime Ripard
     [not found] ` <1463500571-28970-1-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>
2016-05-17 15:56   ` Chen-Yu Tsai [this message]
2016-05-25 12:38     ` [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails Maxime Ripard
2016-05-17 15:56   ` [PATCH 3/6] ARM: dts: sun5i: q8-common: Enable USB-based WiFi Chen-Yu Tsai
2016-05-17 15:56   ` [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display Chen-Yu Tsai
2016-05-25 12:44     ` Maxime Ripard
2016-05-18  8:13 ` [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals Hans de Goede
2016-05-25 12:40   ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463500571-28970-2-git-send-email-wens@csie.org \
    --to=wens-jday2fn1rrm@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).