From patchwork Mon Mar 23 14:49:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11453167 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 BDF5E92A for ; Mon, 23 Mar 2020 14:50:56 +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 9BCDD20753 for ; Mon, 23 Mar 2020 14:50:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HA2yobZQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="NqNc9XHo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BCDD20753 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=jcDdhVxNsPuvA7fxz/g8Na4lvZT9dMn3uCIvn9N665c=; b=HA2yobZQLPZd4G 0dEj1WZQG6ryh4oGXGRdQzT918jcRH9jF0GXZiUiaM5W6/hheHlTpI7bCvLwNSO6yzIcSzqRrJZqU uwN8GDAtC2uR6Fg+stPFU3EOK7cCVZ3SudWf0pbx/SCWic87wfVwXQW47bKJ3EuDORxst8MaUFuWE W5Oicw5rz59L6S9QA3TyRsfEUV60JLWj6qSBA2rMS/m9UKaTPfpqnYWjqEDYDkboqzJpETSsyTINN Q7TB+pfmsrwVRUjs9fo5foaVq+1UJjfoVqM3qfV9fUMAis2lRD/A5F0r0rMVcevWXJH3AK1XWFJ+k JtbmTwg10E7DSuEh+WcQ==; 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 1jGOPh-0002rg-Ql; Mon, 23 Mar 2020 14:50:49 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGOPf-0002gY-8S for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2020 14:50:48 +0000 Received: by mail-wm1-x341.google.com with SMTP id c187so14950070wme.1 for ; Mon, 23 Mar 2020 07:50:46 -0700 (PDT) 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=i34UbOzUs3REVmAk537DyHJucnx+pUblYHjMYnRBadQ=; b=NqNc9XHoIQZ8V6qZY8+MeP1dG+j4Hvxyvf7S0NYS9BnpjAt4yansdlyvBEq9+ewTMe f33PqnD7Kr8gQe5qqf8ONzbgvxl8LDkaapE+XnTdergoGgYcJVxD0Ct0dm7jFYJrQzii bhOUKF6S5AhgZW6Oyr2xxHMsoXyrn4vseWNFQ= 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=i34UbOzUs3REVmAk537DyHJucnx+pUblYHjMYnRBadQ=; b=DDbNxE0m/nz/A4MaHvaLo6y6KGr1euLdte6+oTFiICixpzAxwN19JrGVG6DFgXGWZT lDB1MRipzOCUfjiC7QsCbOuu5iU/8HQCdwlzMz7ZR3LQHOrXmtdtaCeHhdSyP0q/0dei KQAn+YE71i1hUPe2lLDgqE+dbugTBMUYHKoMQwQCNhi6wd1Iveqk+6XBlq7Br1dZNruD bXa9FzG7wgxawkqhL5GsiS/Qr7/P7FUiZyIr39kpAVVmb1EbXdQfie2ZHpUPWeLAdeRU wskDdDNRULvhu+ZzZLfdEoYkeXn3aWp8xxljJTHljCWrt/Q5V6R0R99oKTvaKGGAu5HQ Ib4w== X-Gm-Message-State: ANhLgQ2r8KOZFcQ5O54Ng7qFkf9MeiGVaUvg4n0f+hcgnQVS0S8E5iA3 8cGVb19kU/1RMiEHJmHCT40+YQ== X-Google-Smtp-Source: ADFU+vvry3T0NfLoW2WN162JPNdEkpQ0wBkkc79L4miLaCxGPcNEj2L8c1iiwD3cwBqU4s7IAUyDAg== X-Received: by 2002:a1c:a9cf:: with SMTP id s198mr26541733wme.115.1584975045317; Mon, 23 Mar 2020 07:50:45 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s22sm20376522wmc.16.2020.03.23.07.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 07:50:43 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 34/51] drm/meson: Drop explicit drm_mode_config_cleanup call Date: Mon, 23 Mar 2020 15:49:33 +0100 Message-Id: <20200323144950.3018436-35-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> References: <20200323144950.3018436-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-20200323_075047_372467_321D195B X-CRM114-Status: GOOD ( 14.36 ) 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:341 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_VALID Message has at least one valid DKIM or DK signature 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 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 23 14:49:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11453229 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 8BD4192A for ; Mon, 23 Mar 2020 14:51:28 +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 5D0BC208E4 for ; Mon, 23 Mar 2020 14:51:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SlLO38q0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="M4Twmz44" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D0BC208E4 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=Dg1n5mLvsohkE2sbAPDGYXHYr/2BOvX0MocUN8Pd4lw=; b=SlLO38q0z97l7u 31GLVM711DMIb+9Rlr2dmA2pyA7dUQDWbin8UWgKafJR5T4TLOlc5FGveF1SGusfCIDTS0l+mrjPA KnHc9LppaZOxu6dZ+qRSLiCLLNVNulCmHVC6PwxpFLRSEDoFbauty8jFX0PytW1ujm8FZLu66S1pI 3qB43gbeR7QJBK2v2iUzZMUdmmstH9zY0SEYz/LyH5EyYnSY2D3DrE/dwzxTa4UQZ+LYRfwFnq7Ze WSSvSMUgnLyln6GS0tQ6CxqHMkxnTOwjdiEg9YBFrmFqD1u4bY+f8WFnYh3XV5A8W8KYg+KhQxXbm 05KF8XRcQDlxOOGQOUWA==; 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 1jGOQG-0003YX-Uc; Mon, 23 Mar 2020 14:51:24 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGOPi-0002s7-TT for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2020 14:50:52 +0000 Received: by mail-wm1-x344.google.com with SMTP id b12so1953890wmj.3 for ; Mon, 23 Mar 2020 07:50:50 -0700 (PDT) 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=1JCoenPslol75s1mwKYdO0GZN9e4Jdsynr67HpA/NhM=; b=M4Twmz44U44lVNMnwYgqP2gQ0TGx5tYk+qytMLBkFzUEICdBVGBZbGpBSC2XNsQrZN WfPn3FqbxyUt3+ZGV0kc+gN0a9bYCCSrCdRbMZSnCB0J2OmP2P29t75A9TIW46fYN2qG dEjH0nXCrABKIkP+3CinCbvSvEd5i0cuB+K3s= 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=1JCoenPslol75s1mwKYdO0GZN9e4Jdsynr67HpA/NhM=; b=rkP+JPLdCaY1Rv8uEGVvMjNXrnbp86ecUo4bOSgFdgfECLbXBjMW6PMQZkbEg0Kk/D Z6Jq6f72xq1EH9bXLRuKSxFr+lqWnWWJ9HvUq/dm5DcOIux0eseYm0/7CZ5d151oE9xO oIBqky6CFTiJh7wtAu9z4YEdEBdE5V0Y5heY3FTLZNZcosz0eaIuZNYI3l44m3o7EUuM ZlG8i2tvzkAB4NeHj/MVD+owzbMlN6wAX8IEYOI8jxhJ+f8jNVZO3P/cq4NjR2FkHM94 DNmT1v59coazpYuV58EdqLmBPztJYwK/z8tw3ikUAWJP8VQ+sG2k+xLaVkRNmphZtkhN tU0Q== X-Gm-Message-State: ANhLgQ1CLUaA35scTlP8MK0Xfo8oVLJxbz7giVt+0PWaTESRLlFCDpoN MYJ34fyONskiz0XMV3OQ2uacpQ== X-Google-Smtp-Source: ADFU+vt6UD0sIJ4p1KGfRPTnfOQAVI2yGhyIDGEb0Jkzi+wNUZhE6eYX0CXu28fbIM4NDQ77SQzQpg== X-Received: by 2002:a7b:c8cd:: with SMTP id f13mr14363531wml.138.1584975049565; Mon, 23 Mar 2020 07:50:49 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s22sm20376522wmc.16.2020.03.23.07.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 07:50:48 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 37/51] drm/rockchip: Drop explicit drm_mode_config_cleanup call Date: Mon, 23 Mar 2020 15:49:36 +0100 Message-Id: <20200323144950.3018436-38-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> References: <20200323144950.3018436-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-20200323_075050_964657_C5CCA41B X-CRM114-Status: GOOD ( 15.67 ) 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:344 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_VALID Message has at least one valid DKIM or DK signature 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 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) Acked-by: Sam Ravnborg 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 --- 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 23 14:49:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11453251 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 9EE0392A for ; Mon, 23 Mar 2020 14:51:39 +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 6E4A620753 for ; Mon, 23 Mar 2020 14:51:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OQKiTK8M"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="DFBuV/vH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E4A620753 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=zXRv8XoXSG26W2qCdBqjLzcP5FLquwjOxAyyg1qWIzk=; b=OQKiTK8MCYMEBN 1H7w7GqWWU2lsfCbbz3HItmdewm2T0gDTyiSAkgmEo3Q7bVf0807Ucgxqh8Ljq1C5q4IkPSaXfRu9 t2ECSa3zdCjS6/dwwPq0jtuUHXycGenCcla/D+kssGP9m9aDyUDBRVJ4AzWV7EiGuugYDKjTTUM3o oJyXvYSCT/2pPUyFFXIrYlbspcxYOtsXDtW84MMmt44EpH+hg5BgTbJkYJ72JmJ9irpV1iluH0lR/ ZRRIotlKNTpIX+2U9OjZb3NVzfcA62j5V318jJ93uqflnNUaRuqNsj1fRO682bIbQa6vxV3OHjcVW Z3PBPKqLJvdXEJTLfTbw==; 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 1jGOQR-0003j5-Dz; Mon, 23 Mar 2020 14:51:35 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGOPk-0002u3-EM for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2020 14:50:54 +0000 Received: by mail-wm1-x341.google.com with SMTP id g62so15132027wme.1 for ; Mon, 23 Mar 2020 07:50:52 -0700 (PDT) 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=Xv+IrwzuQ23kGkBFfkZ4yhYMKBg9vr4BWeG8XNXKFTc=; b=DFBuV/vHRlNy4uJgrHIviIKNEHIGV8DUY+m8Sf+lTTyhzMxZEKPTCOQJ6YV2BBEW6P /aR0KqcuCP7S7DbHXwUiuCcVeu9B/+SJ4+kFhRl4eHQaoHYLCN4Z6eWTRuk2PftIsH3z kRT6/M6GKtBM48YSYRBFw6eY40D4ZLZbGjffw= 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=Xv+IrwzuQ23kGkBFfkZ4yhYMKBg9vr4BWeG8XNXKFTc=; b=EgUxdgDpPNQtLBXXob68StCHrpXTRnmiIENLijxOsP7WYTkQuX0QYP0LFpsoRxD9AE Bt50Wvi9Zis+93H6cftF+kl7ptqGwdPPvWHk/XlpkViwF8z3gLvewcRol+oRzRVkiYCp Y6c58qq3mecIwtYTD2BGsBOLHiGYIW1UsCZTgT7BfgWY6ZZFB3XhDWu/LEFTQBlrSjK3 k/FsakuF9CBS4i25GaiW60BPZOd/JGPKhlQCjbXNJFCFODz8QH5kOAOLqdP7HxeeA8gX A6CLRDcYM8o4AhT9xJGDWEzuHVU4q2ulG41RHaxb3jEqbrLmzIB2b2RuceNcCKA0FpqG aaJQ== X-Gm-Message-State: ANhLgQ1jf0YXCaajPAgNwoKuDgKSJQDyjpJHJw6kn++LtGgnh4FYxopO dZY+73shGFfm5uZDDXU4v8NOOg== X-Google-Smtp-Source: ADFU+vszAryUzDEXodO9VeF21jcLEW9fueenhM6J2rfMAdMCTpAiCypypKtGWjmlifuRUoMyaOqCvg== X-Received: by 2002:a05:600c:10ce:: with SMTP id l14mr13066649wmd.161.1584975051183; Mon, 23 Mar 2020 07:50:51 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s22sm20376522wmc.16.2020.03.23.07.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 07:50:50 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 38/51] drm/stm: Drop explicit drm_mode_config_cleanup call Date: Mon, 23 Mar 2020 15:49:37 +0100 Message-Id: <20200323144950.3018436-39-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200323144950.3018436-1-daniel.vetter@ffwll.ch> References: <20200323144950.3018436-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-20200323_075052_502067_2E40B234 X-CRM114-Status: GOOD ( 14.24 ) 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:341 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_VALID Message has at least one valid DKIM or DK signature 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 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: Sam Ravnborg 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 --- 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)