From patchwork Thu Feb 27 18:15:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11409225 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 4C20A14D5 for ; Thu, 27 Feb 2020 18:16:17 +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 1DB19246B2 for ; Thu, 27 Feb 2020 18:16:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kS0cSAAt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="j1urywz2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DB19246B2 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=sC9KRRKISd820bwT0ZRPhvRH08j4+G3/OlFYLoe9CKI=; b=kS0cSAAthCiw8e Jsr11mcVJqvDk6Vn7YdrW6WUTXFDZPdNcEZ6ekmpGLgFVrIOKc1YkzYxlODvVm0LPWbn1pNLQD1aR eavpsNDnJnoAnmrOOUdOG/NrhnzqJMQdLSjRflPF3x6i9SqTYhTOH819prSuLWpmVex4tWImkLQd0 M+66S8IWYKtIxbQ30N4zK9QSsFSxG73ZhzUYX1lKcJ6Miv0FcuRLsTiRIl7ZbGIMGKppOJiL6v0jb Lol4EOGgu+si7OEi3B0yUgu68/AuTJ26ZZC5Ak4oM9xUlSWHkgWeTidSMoNvoCUdxuKB3F/nF6jZp T2YrVbOFOSuhF96rIGQA==; 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 1j7Nho-0003Fo-L4; Thu, 27 Feb 2020 18:16:16 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7Nhm-0003Ek-2B for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2020 18:16:15 +0000 Received: by mail-wr1-x442.google.com with SMTP id z15so4673869wrl.1 for ; Thu, 27 Feb 2020 10:16:13 -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=jT8UWtmCEe7v58pjwlPCLN4e+N26kni/TNK34oplFDI=; b=j1urywz28vACwh8HeXCI0pWn82lWe/B/YSJs06vF1xxUNVwLwrWhvEcZUCt+X61S5B B4EFdH6XlxywuP9aOi6Byn4Bmz1vczC+Gp9d7e5XmInWuFB2es3F+OYp1ZA68V5cLlLG 1rgm/RSRSw/Vw7nRvs2pGGUg/ufCKGhRrtrz4= 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=jT8UWtmCEe7v58pjwlPCLN4e+N26kni/TNK34oplFDI=; b=Xm8ZY4fDlnbLelNRzo8rwq5WYio60PHuenSlxceeVFWLZh1t+ERDZMRM6ChLHKqWho eFywkSNNH/jvjQF8XE+KPEUi5IaKGHE9whfLkUGotSVWGrG3kD7TEjBzqyWlLOvNa2G6 IkYDWnJSLuri0G021teCtkdLT+GNub/17VwTDHciwckzkhtu+NRYPYKY/UP0XYSuIqf8 +hH60iLxvqD03EUvk5BrYInhXBtZUWBWCLptM3QmNLYn1iF41MIC6r+lVtc/tGgyRr35 fPl+y8iyoeSHvcUYx27wf+BCStdRmnqI+MoyniByjawhX2PGYIFUj6ciicOLlD+d5es0 ELjA== X-Gm-Message-State: APjAAAVX+qCHEj/dikVWP/cO6EzKeJVQRRmsarOJ40OB7UgQDMlW2A7K nPreUEH4KKS/P30sCcv8GTes2w== X-Google-Smtp-Source: APXvYqwp8W10k7C5K+ykKuRFLORaJou4Cd5K/QJEEhZlzQs0FVvABfEDei7QmchEa6j8YPIsywTXaQ== X-Received: by 2002:adf:fc08:: with SMTP id i8mr153646wrr.104.1582827372723; Thu, 27 Feb 2020 10:16:12 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q1sm8551152wrw.5.2020.02.27.10.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:16:12 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 34/51] drm/meson: Drop explicit drm_mode_config_cleanup call Date: Thu, 27 Feb 2020 19:15:05 +0100 Message-Id: <20200227181522.2711142-35-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200227181522.2711142-1-daniel.vetter@ffwll.ch> References: <20200227181522.2711142-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-20200227_101614_105699_36538D5A X-CRM114-Status: GOOD ( 14.72 ) 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:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -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 -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 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 , m.felsch@pengutronix.de, Laurent Pinchart , Kevin Hilman , Daniel Vetter , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de 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). Reviewed-by: Neil Armstrong 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..ae94d14ab7bc 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 = drm_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 Thu Feb 27 18:15:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11409255 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 930CD14D5 for ; Thu, 27 Feb 2020 18:16:40 +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 714B02469B for ; Thu, 27 Feb 2020 18:16: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="Isco8xjX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="jBqiUuXV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 714B02469B 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=Mc4F1aBdUgzinpFGLIqio7ttMl5WDUx6kjp+z36OOAQ=; b=Isco8xjXPKrowi tabAhIxCEo3lO1jwAYHFzr94ms+t5Zqauc7wf33NG2AERQYIDIW889YQDdB9+XsWDsMThJLalLHcB uE642KEq/VEmwZM1wL4zpLvvS11z9RBkFxl0Y3JOJ7p21sdkr0tbGxBCZIsDGWa1OUuAFwGkB3aKb M8t/9a5GDGo8mFhU5NRPzKN2/vhsNkkTD1C5rCUbZfxZdubzwiKO6MiRWX5w0UsFC7sgxo3PuXUXo 6Obb+mcVEpPVa4MNbV3NKQrY4v2djqFI9sbUrrdYYfmf2fkP98ll/rFGSjRq9l45jgZLL2ExeKK3F MqvOPXSQ5QAPTN8t7iUA==; 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 1j7NiA-0003Za-U5; Thu, 27 Feb 2020 18:16:39 +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 1j7Nhp-0003Ft-Lp for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2020 18:16:19 +0000 Received: by mail-wm1-x344.google.com with SMTP id a9so423424wmj.3 for ; Thu, 27 Feb 2020 10:16:17 -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=XH8HTUf+N983dtr3AIooE5hJOMY5xFR/UBpOsmUWfIc=; b=jBqiUuXVh/JvEPipboAuXj5XTLXkZ653TgrBZRVEUYce1lqQQ1NF6ER3HLGYfAX4UB J68ARKFjIsdYaeyLanHA4/nYkX5rdrVqDhN7sfsACMUjAy0f6ePOLt+gEzkEV2Yr4sZ5 YePxoooDN+WrFAdSqT628QgnmFAXltgaUaCrA= 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=XH8HTUf+N983dtr3AIooE5hJOMY5xFR/UBpOsmUWfIc=; b=SgjiVzCCNC2YzdiHMKbdaKiFx6nvV54aVgKY+Ie+eoLPead+lVJgK1lurxBbxNGoip vJ22rd7svRMtBFJVX9PYW5rj/D2boD9zlo2ayzytaE1OK2ChxoYtm241zws4V/TsjhDp VV7xYQ2TvpMwIZqStxzxvq/m0JZBGOjYmDNy2YAa6OqawxRmkrWjc75ZVaqjaKmyXG92 NXGVXMnE7Owq3O2QhWjDs2YD4lC7OsdnQrZ480s9Qp0B1sZaGZaJsMOdDKOm6GiEVR9P zeep9vzjuttYk+MQt8U2M0KGyDouhKBHwW9PUAIXnnlpyp5VEwufq1X3p3KgR+EM45bl 2clw== X-Gm-Message-State: APjAAAVpRUWL9Lcwg8IdKnsSNhKujKkwy34FPZhlVEdWq9uMD+3/Jc3C ewhnkbIy8xhLnrcsPIFgfVs3EQ== X-Google-Smtp-Source: APXvYqxCJ7pjwNsD57hr7a7J+I8OTlXejrkTgzdaMEIRKxXonn5EVsjHkCo0KzWPeU7M/N12HjkftQ== X-Received: by 2002:a1c:1b4d:: with SMTP id b74mr26180wmb.33.1582827376145; Thu, 27 Feb 2020 10:16:16 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q1sm8551152wrw.5.2020.02.27.10.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:16:15 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 37/51] drm/rockchip: Drop explicit drm_mode_config_cleanup call Date: Thu, 27 Feb 2020 19:15:08 +0100 Message-Id: <20200227181522.2711142-38-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200227181522.2711142-1-daniel.vetter@ffwll.ch> References: <20200227181522.2711142-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-20200227_101617_736078_497CC8D6 X-CRM114-Status: GOOD ( 14.89 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -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 -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 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 , m.felsch@pengutronix.de, Sandy Huang , linux-rockchip@lists.infradead.org, Laurent Pinchart , Daniel Vetter , linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de 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) 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 Reported-by: kbuild test robot Reported-by: kbuild test robot --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 20ecb1508a22..9b2502f92018 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -135,7 +135,9 @@ static int rockchip_drm_bind(struct device *dev) if (ret) goto err_free; - drm_mode_config_init(drm_dev); + ret = drm_mode_config_init(drm_dev); + if (ret) + goto err_iommu_cleanup; rockchip_drm_mode_config_init(drm_dev); @@ -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 Thu Feb 27 18:15:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11409295 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 87F5513A4 for ; Thu, 27 Feb 2020 18:16:59 +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 665772469B for ; Thu, 27 Feb 2020 18:16:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Stc7lpzj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="cakfD6r5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 665772469B 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=HLZm7gG18cZeMZc+VoACiJg717A3jeBF4erQmAg1Y+8=; b=Stc7lpzj9i4Kap DKSMryEEQI8agOCZHbSXzGQr8JPOwGU0j5rmHM8tIa50E7UCNtOelCfmNpDVdEotryNLWhUjMzd6L egfu5OWdzz9TYzphF0Oi/t1dN43KpziujlVdx6vEEp4a+rb63jFes9jPyDM7wFybCTNMf1dsHcMNW Jqow6T7K+RK+e/QMHuKFw8mzhuO4pXewcYWGTZbJMoUzeAOYRRhxb/BNre3VjUqBKehb3538s4GNK nG1DfAqzzSoqZnXSfMMTo73yUCx7ZEVxHN/IcIHXgXA0EfwW/9fAR8uIKu1ORkcRhNEzJ3+jT2XJb jfhy7WZG499r94clXM1w==; 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 1j7NiU-0003sr-CM; Thu, 27 Feb 2020 18:16:58 +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 1j7Nhr-0003II-Mj for linux-arm-kernel@lists.infradead.org; Thu, 27 Feb 2020 18:16:21 +0000 Received: by mail-wm1-x343.google.com with SMTP id a141so435972wme.2 for ; Thu, 27 Feb 2020 10:16:19 -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=HAoa+ReMwHomgBUwnpPQde3KSJuaKiY678ziXw+Di+w=; b=cakfD6r55fCvzGarKFBqYglf8FTssyC3z94iBfMxX+RPvDStBq4cJ6PQluE3NXoaOe Jto68nza+PDrdJJgHDwMNDtBeDYMu5ZydgCkKAqOm/u7XZcdUZbInE47pFHWWth83QYN USDSLZ1mGj4L2n8QFTT+064FlhOP91dlGGxyo= 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=HAoa+ReMwHomgBUwnpPQde3KSJuaKiY678ziXw+Di+w=; b=DQN5WsuMdnRP/ZA6ygB/tGQkVPuoSRDmwXYzVAin+fDc7HzGO7DKUYPVXqAogRhUCb sejOydpGFTlQAK1b8S1K4ofbGDf2vJoKLzYNMgu139bAnv3eWPzTrqiqMQWZkKNYmK0U 36F8Z3D8t1dupuuymSJwpmOd8yUMciFRFS7p1TDqgjcIfFWZEjVcxsa6BsbcAbbm++sk VxumWgzHYTbkVzRH0Ypoa3jGZlwuMqsnN284LrzjWeYVb4NHxX7ik0H1/d6tgnRXZgOv fUZ0JewMP0Siw9nU/4p1GIGdYkaM3nGsULR4pCqi9msNtbxQQ+aPBPluWNqbsu4kAsnI uwEg== X-Gm-Message-State: APjAAAU4PHJdR1sub+SCApnrckbWOtY5pTPjCWQGAHyDQ6rOmDl8eVkQ g9LOhm5ZZSFHevKZAf0VE01ERg== X-Google-Smtp-Source: APXvYqzESsriBDxrVIZJy4KqipgF40cfCthLA8Ed/cuXHvWibnJy7wBKDwRSLha8t+4ho2lGul0IBg== X-Received: by 2002:a1c:1f56:: with SMTP id f83mr15585wmf.101.1582827377964; Thu, 27 Feb 2020 10:16:17 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q1sm8551152wrw.5.2020.02.27.10.16.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:16:16 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 38/51] drm/stm: Drop explicit drm_mode_config_cleanup call Date: Thu, 27 Feb 2020 19:15:09 +0100 Message-Id: <20200227181522.2711142-39-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200227181522.2711142-1-daniel.vetter@ffwll.ch> References: <20200227181522.2711142-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-20200227_101619_759974_4740CE0A X-CRM114-Status: GOOD ( 14.60 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -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 -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 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 , Daniel Vetter , Intel Graphics Development , Philippe Cornu , m.felsch@pengutronix.de, Yannick Fertre , Alexandre Torgue , Laurent Pinchart , Benjamin Gaignard , Daniel Vetter , Vincent Abriou , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de 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). 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..5b374531dd8c 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 = drm_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)