From patchwork Fri Sep 16 18:22:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9336371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42AA06077F for ; Fri, 16 Sep 2016 18:22:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 390D92A061 for ; Fri, 16 Sep 2016 18:22:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D86B2A064; Fri, 16 Sep 2016 18:22:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2CC32A061 for ; Fri, 16 Sep 2016 18:22:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C746D6EB0A; Fri, 16 Sep 2016 18:22:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 690EF6EB0A for ; Fri, 16 Sep 2016 18:22:29 +0000 (UTC) Received: by mail-qt0-x233.google.com with SMTP id 93so46881122qtg.2 for ; Fri, 16 Sep 2016 11:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=rbsJOBtfok01DZLYne2aZTOjM0V3hxfcXy0Ze1Y8xb8=; b=ZdKsQtIQQNom2wa9JsFUFA/p22CHOvSRDDvxroyRuNqWCPnSEybcxzkwiDcbxS1JAG tk0fW+C486rcU5kUoiQIHLB49gRkHiWBpITzDEkaU95lYVudiqa7OfbeHmVSVRaJnmXK XayeGyIZfbd5gRaMt7WWk+XP7cihuCTgTVWR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rbsJOBtfok01DZLYne2aZTOjM0V3hxfcXy0Ze1Y8xb8=; b=DoJg/+VqA4uXRzoSImXSoFQv3EjprhyhDsbSdFtMi75VhR+eL3NJE4YtZGcKk5BKhW e9N8qOK1zFBHbDkNnlBazERzG3/cXsFidmJ/HxcT/t9MIOmCRj2i6mKfAs2VvsPzrFsV a8VZp9hY5AhdJdmXeXGswx6vUCBonWWa7NJ2r/EoW+52v4YD1imaxqoG2MBAO40gC6zm 4rzblPddKBZ6nagfYmCJ4uCHr76YrxFZZz6T+UdtLQODSljjn4BB8taC+hDx1WAXVfoh 0jMBB5RUFmD8H26uYq6UrsVG8zF6bdecAL/mi2pUrHr5lEA8uUbDpfcYje4fguulzD87 pbHw== X-Gm-Message-State: AE9vXwOCLT4wojtejc9TFZlaTNig2ktMdrc7dwzq9zpowrUhIookxQLztjVigAUrmtaVYxVs X-Received: by 10.200.37.205 with SMTP id f13mr17463940qtf.79.1474050148004; Fri, 16 Sep 2016 11:22:28 -0700 (PDT) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id s23sm5393736qka.10.2016.09.16.11.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Sep 2016 11:22:27 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, heiko@sntech.de, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/rockchip: Cleanup dangling devm pointers Date: Fri, 16 Sep 2016 14:22:23 -0400 Message-Id: <1474050143-29962-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Cc: linux-rockchip@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of assigning device managed resources to local variables, keep track of them in the vop struct. Signed-off-by: Sean Paul --- 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);