All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: mark.yao@rock-chips.com, heiko@sntech.de,
	dri-devel@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org
Subject: [PATCH] drm/rockchip: Cleanup dangling devm pointers
Date: Fri, 16 Sep 2016 14:22:23 -0400	[thread overview]
Message-ID: <1474050143-29962-1-git-send-email-seanpaul@chromium.org> (raw)

Instead of assigning device managed resources to local variables,
keep track of them in the vop struct.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 131ae0f..bed782e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -142,6 +142,7 @@ struct vop {
 
 	/* vop dclk reset */
 	struct reset_control *dclk_rst;
+	struct reset_control *ahb_rst;
 
 	struct vop_win win[];
 };
@@ -1333,7 +1334,6 @@ static int vop_initial(struct vop *vop)
 {
 	const struct vop_data *vop_data = vop->data;
 	const struct vop_reg_data *init_table = vop_data->init_table;
-	struct reset_control *ahb_rst;
 	int i, ret;
 
 	vop->hclk = devm_clk_get(vop->dev, "hclk_vop");
@@ -1374,15 +1374,15 @@ static int vop_initial(struct vop *vop)
 	/*
 	 * do hclk_reset, reset all vop registers.
 	 */
-	ahb_rst = devm_reset_control_get(vop->dev, "ahb");
-	if (IS_ERR(ahb_rst)) {
+	vop->ahb_rst = devm_reset_control_get(vop->dev, "ahb");
+	if (IS_ERR(vop->ahb_rst)) {
 		dev_err(vop->dev, "failed to get ahb reset\n");
-		ret = PTR_ERR(ahb_rst);
+		ret = PTR_ERR(vop->ahb_rst);
 		goto err_disable_aclk;
 	}
-	reset_control_assert(ahb_rst);
+	reset_control_assert(vop->ahb_rst);
 	usleep_range(10, 20);
-	reset_control_deassert(ahb_rst);
+	reset_control_deassert(vop->ahb_rst);
 
 	memcpy(vop->regsbak, vop->regs, vop->len);
 
-- 
2.8.0.rc3.226.g39d4020

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2016-09-16 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 18:22 Sean Paul [this message]
2016-09-19  4:14 ` [PATCH] drm/rockchip: Cleanup dangling devm pointers Daniel Kurtz
2016-09-21  7:36   ` Sean Paul
2016-09-21  8:55     ` Daniel Kurtz

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=1474050143-29962-1-git-send-email-seanpaul@chromium.org \
    --to=seanpaul@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.