From patchwork Mon Mar 2 22:26:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11416537 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F018F17E0 for ; Mon, 2 Mar 2020 22:27:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE88224677 for ; Mon, 2 Mar 2020 22:27:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JvoE+Fa7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="MrPcnxfb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE88224677 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IMrCQIAgSK720atLmZisjz5b4UHPJtKvQYaNYPJ0Qmg=; b=JvoE+Fa7RCjIhc NzpyDAbPCc9BTZlZH7KeFpbh3hXwCL4xmM1qZ86ere+PFxz0bZDj3pZw4jUPAxXhJ8juQAytbQLXy cxEeWbiWIEjCgzayxQM5a8mZDNs+jVsI4dp2E25f35OvZ/8WAoiowxC3rfJscPiT66oOvYriubxu4 HXuTYHInDSdxF3ETVZ2lBUU2cqYybRGl6cDEJsMLa6sSegvdAxKtRKAfdrbcXUSk+zawL38OHR9WH ze9jkQW1DgWlt8l4VBIrzckMBiO3wjtf8cAUFRgxj2zsFxfjIFwHHX5ATG1CNkHdqrSOcai1sUn/M LeNSDxQ+wM5Ep1j8iyJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tX5-0003Pk-2E; Mon, 02 Mar 2020 22:27:27 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tX2-0003P3-Ha for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2020 22:27:25 +0000 Received: by mail-wr1-x444.google.com with SMTP id r7so1902756wro.2 for ; Mon, 02 Mar 2020 14:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pw5QqrfG2RgLwLYrDhVp80l9fnGnOfrvey/8drqHpHM=; b=MrPcnxfbao07IGiixrPJTSeiauRZ8LZ1xF4DnuO3LKoMbZSliTkgsyK1ISWn3+ATg/ hqtxg9jIMaJJuUeKgr/cvqPHeEx91V9x8m5nswQCxmKrksE+uxavszHdfkZAIMDw9prJ jeVXdjMlCSK/9uaPsaRICjfdND3cREQg7v/Es= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pw5QqrfG2RgLwLYrDhVp80l9fnGnOfrvey/8drqHpHM=; b=MeIt6pMFIK5xqg+4SnFdK74NhnxMc9bgLDRstIJjItYfvruD/Wcxirha5UM0LTv78H /rNKrq/ZI3o7p74Y7XKoesY1VfPAhstMvFFSpT4FlVnPYQBw0bENgLtxQmL2ht0Ah6QK g8/UxsUbj7SA8sBvj4CKMwvq2l8uc3yQ6Y+iWJ3TUs2h0A6AmdGG7AWOaLTPjT+tf5h+ zmGEtJOBwwKZVw4vg9MST6R7R0hCKWFnBkJvkXW3f5yQuxsp4ZgxLGcPvZ31hXDrT3Ez VxUiv9PIiTwhj4RT3VJuA8W4NG97PFHUQIiDfP8AlYw4CdnBe1OtQUxzNQ3IvpHjyPTI qHSw== X-Gm-Message-State: ANhLgQ3ibcRN6+m489VfBnF3fAvji9TkWrtWzJIw05sfy59JsxFMQ7AO yX7HxbVwkcNOy+Gz+hEMFm019w== X-Google-Smtp-Source: ADFU+vsTFOKD20gzbzZfkTT8QuXbSOhK0ILlysvVCCIQ/Jhu4BysiOPZ5axKJP8OA5+1qd/7gZ3zxw== X-Received: by 2002:adf:df8f:: with SMTP id z15mr1599343wrl.184.1583188042987; Mon, 02 Mar 2020 14:27:22 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id o18sm26114589wrv.60.2020.03.02.14.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 14:27:22 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 34/51] drm/meson: Drop explicit drm_mode_config_cleanup call Date: Mon, 2 Mar 2020 23:26:14 +0100 Message-Id: <20200302222631.3861340-35-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> References: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_142724_582218_D05DDC18 X-CRM114-Status: GOOD ( 14.51 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Daniel Vetter , Intel Graphics Development , Laurent Pinchart , Thomas Zimmermann , Kevin Hilman , Daniel Vetter , linux-amlogic@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: This driver gets its devm_ stuff all wrong wrt drm_device and anything hanging off that. Not the only one unfortunately. v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Neil Armstrong (v2) Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Neil Armstrong Cc: Kevin Hilman Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/meson/meson_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index b5f5eb7b4bb9..6f29fab79952 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -284,7 +284,9 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) /* Remove early framebuffers (ie. simplefb) */ meson_remove_framebuffers(); - drm_mode_config_init(drm); + ret = drmm_mode_config_init(drm); + if (ret) + goto free_drm; drm->mode_config.max_width = 3840; drm->mode_config.max_height = 2160; drm->mode_config.funcs = &meson_mode_config_funcs; @@ -379,7 +381,6 @@ static void meson_drv_unbind(struct device *dev) drm_dev_unregister(drm); drm_irq_uninstall(drm); drm_kms_helper_poll_fini(drm); - drm_mode_config_cleanup(drm); drm_dev_put(drm); } From patchwork Mon Mar 2 22:26:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11416559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89EFD1580 for ; Mon, 2 Mar 2020 22:27:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D9802465D for ; Mon, 2 Mar 2020 22:27:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Olc3Qlfc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="eWpy+GEx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D9802465D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oaX2OHIWwoMX6hpUW2ndSqUkKiss4/bYfAZMvEW3qGA=; b=Olc3QlfcqtMkeL 3pAULgTRzO/EzP/LMlIzPxdtUfXpXf9NGumo5ZSs6YgtZy7ymbcKejAsGReaoNLP7s4dY3HR4Jpig 6ndvBjb3l4WGtMaWxWJED9AVVzOWkUjBOLo/bAOImOQFsxt3IA24PWTRilQZdUeX2Uc7HRZN6Rfrw wZyQb2/W+h++nQ8lKBLKKvi1CaRWdRjMaE/1/24xtEA1wgg0/p00vTS4utmr3L8t5oLVz8lBHGH4M 6ttLLRJ50tbih79i1gjX/BCmx+jHWPTtxTglLFi19HJ62mEGpecS+idNGLMlE6tqyJWsbAHzvcwmb sNG8N7HF7qfEVmuK4KDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tXE-0003ZG-CQ; Mon, 02 Mar 2020 22:27:36 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tX5-0003Pj-II for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2020 22:27:28 +0000 Received: by mail-wr1-x444.google.com with SMTP id v4so1847064wrs.8 for ; Mon, 02 Mar 2020 14:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c6tQ9MfFxj9jmviVv9z34bxHB/dMfgbPWkMep8z10wQ=; b=eWpy+GExBDRswlCzQY7yz9eJf/6doLzIO5unWFveEZL6bVl2ufR9Hb3h2iH+2l/oBz IhoMEvy+q0Fi2INP+gej+Byaupa5PJBIHxBvfeJ26p7uMs3NZd7SNteI1O8mE+CSy5Is RfxvJ8QMdhmYkvnKScOjpffWDGbB+r27UuxiY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c6tQ9MfFxj9jmviVv9z34bxHB/dMfgbPWkMep8z10wQ=; b=jxN2jc6XVTL3Bjqf2HsDNdrIuSi2kHVD8u/dDIrAg7UPwYaHX+whCxTzKIOzbRrI8k KFKiTn1/weu1VAIdHgmX9WCuvSgNMnX7YyuHz/zdt9pF++BF9gdW7QCqYOMxMQ+Vqi2t eg4aXx853eIcIz+5EUOlWVyIbVXEd/rEvUZavmx+PZUtTKeuBjyOhqRjRnwickr4UIs6 t+McMIn7C3WZS+vBpCoabdbvn+nL6Pu03yFaiwvkIHxa0Z/SSLzIHLdW9MbRlUdAduUQ R60tUBP6GTXd7Z6d9FRvUHUSeDOk/KY/5J3NzRw2/8/xzI6uXTW9H+WUBlikFdyLEhkc HNQA== X-Gm-Message-State: ANhLgQ2VfvyD2sbbBVu/l2ycF4FHNzuRRpYpW3Aa8VrQYl1ef2jkdajR TYqaWD9AOr2XvYrRTcg98wtAkQ== X-Google-Smtp-Source: ADFU+vupqTzURou/OSClNH9R3NF9co6OO3jTTZgj3hkys1nhGZbZruexIMOoQ0MvxWicN02s2Rwrsg== X-Received: by 2002:a5d:4384:: with SMTP id i4mr1598274wrq.396.1583188046376; Mon, 02 Mar 2020 14:27:26 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id o18sm26114589wrv.60.2020.03.02.14.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 14:27:25 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 37/51] drm/rockchip: Drop explicit drm_mode_config_cleanup call Date: Mon, 2 Mar 2020 23:26:17 +0100 Message-Id: <20200302222631.3861340-38-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> References: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_142727_647723_1ABD7F66 X-CRM114-Status: GOOD ( 15.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Heiko_St=C3=BCbner?= , Francesco Lavra , Daniel Vetter , Intel Graphics Development , Sandy Huang , linux-rockchip@lists.infradead.org, Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's (almost, there's some iommu stuff without significance) right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Jump out at the right label (Francesco) v4: Try again, kbuild caught that I didn't build test this properly ... v5: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Francesco Lavra Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Sandy Huang Cc: "Heiko Stübner" Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Acked-by: Sam Ravnborg --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 20ecb1508a22..0f3eb392fe39 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -135,14 +135,16 @@ static int rockchip_drm_bind(struct device *dev) if (ret) goto err_free; - drm_mode_config_init(drm_dev); + ret = drmm_mode_config_init(drm_dev); + if (ret) + goto err_iommu_cleanup; rockchip_drm_mode_config_init(drm_dev); /* Try to bind all sub drivers. */ ret = component_bind_all(dev, drm_dev); if (ret) - goto err_mode_config_cleanup; + goto err_iommu_cleanup; ret = drm_vblank_init(drm_dev, drm_dev->mode_config.num_crtc); if (ret) @@ -173,12 +175,9 @@ static int rockchip_drm_bind(struct device *dev) rockchip_drm_fbdev_fini(drm_dev); err_unbind_all: component_unbind_all(dev, drm_dev); -err_mode_config_cleanup: - drm_mode_config_cleanup(drm_dev); +err_iommu_cleanup: rockchip_iommu_cleanup(drm_dev); err_free: - drm_dev->dev_private = NULL; - dev_set_drvdata(dev, NULL); drm_dev_put(drm_dev); return ret; } @@ -194,11 +193,8 @@ static void rockchip_drm_unbind(struct device *dev) drm_atomic_helper_shutdown(drm_dev); component_unbind_all(dev, drm_dev); - drm_mode_config_cleanup(drm_dev); rockchip_iommu_cleanup(drm_dev); - drm_dev->dev_private = NULL; - dev_set_drvdata(dev, NULL); drm_dev_put(drm_dev); } From patchwork Mon Mar 2 22:26:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11416587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4E651820 for ; Mon, 2 Mar 2020 22:27:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 820F620866 for ; Mon, 2 Mar 2020 22:27:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lDhzWoA6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="BJjKTa1u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 820F620866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CtlTUNT4iNkyhuUaJ+2IKccPw7ALwgZeLfXGMs6vSsI=; b=lDhzWoA6HXKv8l mzVm+P/s8OS7G0ms6Br73ucRhXB6W+2dNUqnUTVUGyXdMUQ84uqm5tuFFtqL9IaiXZv9BAbOo+MlV i6li+zqCO8YCGm+H+BFCdWoSDLGJ2qMVa0jsjjdA+7IbNg3ylN8j5Q/YLYEGSy5AGzSmjhsmYriCV KXe4y34tRoG3HUaG7fbSHt4Cvdu7YhWnQPjehpKi9L2gS13GvaPseZelHdXJj99Z4IS/Pr32rDI22 iwLhNdrgtY9espg7GNVZdZCc8uzOajc7Ss7oZUM08C5xC9iqImULQw3bu1ZVJxLfFbWkRpzQus7je He/HcKfCLswuxenRUoKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tXU-0003ud-Jf; Mon, 02 Mar 2020 22:27:52 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8tX7-0003R7-Ga for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2020 22:27:31 +0000 Received: by mail-wm1-x343.google.com with SMTP id f15so839562wml.3 for ; Mon, 02 Mar 2020 14:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yl3p3hBPFlOPkoSdkeZjXHmocqTG4wlFcxWCuis8faE=; b=BJjKTa1upJb+zW+g2KemiCGn2oj71gZr7WRaPkD8vJRBh6tVGNq8sk2paLvQUYSgq0 XrvFC21US3WDHdXKJzUUru8SJGuMi5xJsyLE9Lvm+nHAgMwdClaU83nDCp94YBHmpSTS uX5xmOcnuhmuYur3VOpAdoedKgbc+pAeMQ6FE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yl3p3hBPFlOPkoSdkeZjXHmocqTG4wlFcxWCuis8faE=; b=IEtK869PB739+Yj0SBfMhK2taA6wEtDiHGmqeJkQZ9q2ijRau3n1Q1tXeUNinGIAaS xuyCwgmIkbGLmogRYIiiUJJFb/XDvmK3O8FsHypw6SgCya4KReSzcC156gLmhovtRkii CVSufkmvjqMgvaVnUS8ago2u4A4oHgCkz/zn3/Nbeo8VEw5dSALy3f4Lhn0MPLd+loIP VZMCij52Ye208RyZQ4LuYWVnBl7uTjbPcQT1vOnHQHfjdpXAPQhDEN2l0/MJsZ9PGCyq Bo3DflayvfZyi6w+3ADQvAxRpprK3hQ03Pb9LupjWJ22OcWDhxcbGKIbXRf35mPVKj1H BRMQ== X-Gm-Message-State: ANhLgQ1T/YEUtfxgaHKJuq8jOpRCSCHjrIRa7Iv1pSv7tri55AlqKppz EgLnPJ2Qvvxt88kqnjQPtLczNQ== X-Google-Smtp-Source: ADFU+vsV6snY+ze8Mw13KvoxQVCCldm+RRMJ8DbeXSTs1U1dY0PkObe2dTJFMO/9e6eMtrIGTWAiAQ== X-Received: by 2002:a1c:25c6:: with SMTP id l189mr530634wml.104.1583188047595; Mon, 02 Mar 2020 14:27:27 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id o18sm26114589wrv.60.2020.03.02.14.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 14:27:27 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 38/51] drm/stm: Drop explicit drm_mode_config_cleanup call Date: Mon, 2 Mar 2020 23:26:18 +0100 Message-Id: <20200302222631.3861340-39-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> References: <20200302222631.3861340-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200302_142729_604863_E622BEED X-CRM114-Status: GOOD ( 14.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Coquelin , Vincent Abriou , Benjamin Gaignard , Daniel Vetter , Intel Graphics Development , Philippe Cornu , Yannick Fertre , Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Sam Ravnborg , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Alexandre Torgue Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's right above the drm_dev_put(). This is made possible by a preceeding patch which added a drmm_ cleanup action to drm_mode_config_init(), hence all we need to do to ensure that drm_mode_config_cleanup() is run on final drm_device cleanup is check the new error code for _init(). Aside: Another driver with a bit much devm_kzalloc, which should probably use drmm_kzalloc instead ... v2: Explain why this cleanup is possible (Laurent). v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas) Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Philippe Cornu Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Yannick Fertre Cc: Philippe Cornu Cc: Benjamin Gaignard Cc: Vincent Abriou Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Acked-by: Sam Ravnborg --- drivers/gpu/drm/stm/drv.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index ea9fcbdc68b3..0f85dd86cafa 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -88,7 +88,9 @@ static int drv_load(struct drm_device *ddev) ddev->dev_private = (void *)ldev; - drm_mode_config_init(ddev); + ret = drmm_mode_config_init(ddev); + if (ret) + return ret; /* * set max width and height as default value. @@ -103,7 +105,7 @@ static int drv_load(struct drm_device *ddev) ret = ltdc_load(ddev); if (ret) - goto err; + return ret; drm_mode_config_reset(ddev); drm_kms_helper_poll_init(ddev); @@ -111,9 +113,6 @@ static int drv_load(struct drm_device *ddev) platform_set_drvdata(pdev, ddev); return 0; -err: - drm_mode_config_cleanup(ddev); - return ret; } static void drv_unload(struct drm_device *ddev) @@ -122,7 +121,6 @@ static void drv_unload(struct drm_device *ddev) drm_kms_helper_poll_fini(ddev); ltdc_unload(ddev); - drm_mode_config_cleanup(ddev); } static __maybe_unused int drv_suspend(struct device *dev)