From patchwork Fri Feb 21 21:03:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397413 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 A028E1580 for ; Fri, 21 Feb 2020 21:04:23 +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 7F040208C4 for ; Fri, 21 Feb 2020 21:04:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OD6F3+Mz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="kVUB7YsX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F040208C4 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=OD6F3+MzhG3B3y kYIPQDWRC+H+8dM/fjifF9PQ1lFAKDZsiYhaE5p1Dzb2Y6xCcyMrHr1d9ZealGh44JtOuzp8cHasW dRXvbWIhQflvva+FBO05Gg0b0eZcy17uwV4689An6AMAEkTtYWL6ZDWlAGpHeKg+0wLSP+OV6YGF/ I50ApCYH8NPfRqcJltZKZ0gbg+OO77b7IlbeYBpXMMERTLhiSURyWy5DaVWNLfUX5fF51jFRHmaNs XfpYrKbZVq44F8plxKQZQ0KtolGt41pHh1l7DDo22rzumloBzWnnxlw9WSmF0QZ8klY2W2nz0E7AD F2OsDUs2qsty2NVPAYYw==; 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 1j5FTB-00089M-SE; Fri, 21 Feb 2020 21:04:21 +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 1j5FT6-00086e-Br for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2020 21:04:19 +0000 Received: by mail-wm1-x343.google.com with SMTP id n3so3158166wmk.4 for ; Fri, 21 Feb 2020 13:04:14 -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=kVUB7YsXyQFdAalX8Zu/cVMVaG/L+cCDvwZ6URUB+WVQ5u2xM1ZQQTn6TdlDg7ARrm Vgs9NJuKKjiKCSnZKpUcxGvSNwSPngz8UUxPZCNqmsSsgjKwuVWEy48/cw+w4OsY1f2M GwuvdujNleYQ3vcEYDTCAo+29McLMgIe9Q0NA= 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=hICApWHJS3v9W/mrlkiUe56Xq5UMxTwaS+4Z1hStu0WblRRkCdXPL2mt3O9T0PqG+U AAJ1Mm3Xq9yplK7k0V4mveecVsEp3wnRKF/bkATnrM1LmCN8hrG+QkCfoMVN+mFVO9Th eXfMs/KUaG9HsdKLY3GNbYg7H6o8kCqefCAnKSi1Um79qUUKmfUjIOaphj1WtF4TwIhq 0KtGMI3cwlsMbjb1GjLMkktB5X+WZ/aUWb9iU2FqDesgqAd8mPCWXOexAbFrOmXMNzd3 2JJKF+/pjdyYnWBeSyBD0aE4kodZ8yOaleF7sOeh9cAsIpVcTSnixWMEmWvhr1bukGfM AtAQ== X-Gm-Message-State: APjAAAWxlVu2mgE93K9FHtKf6tAmfFBurxa03KaCRNaq97J2z4spWKBA w0ov64rX4s+0YdarV0qAgUiBvQ== X-Google-Smtp-Source: APXvYqzTcLQxzJVLV0ul5onT0Wf22eotmH+CNCufnIy14x7rz8AwYEOSIX3ywkWjz6YNVTIxU50hXQ== X-Received: by 2002:a1c:a594:: with SMTP id o142mr5340108wme.146.1582319053293; Fri, 21 Feb 2020 13:04:13 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z6sm5483930wrw.36.2020.02.21.13.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:04:11 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 34/51] drm/meson: Drop explicit drm_mode_config_cleanup call Date: Fri, 21 Feb 2020 22:03:02 +0100 Message-Id: <20200221210319.2245170-35-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> References: <20200221210319.2245170-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-20200221_130416_467552_139F0902 X-CRM114-Status: GOOD ( 14.31 ) 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -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.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_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 , Laurent Pinchart , Kevin Hilman , Daniel Vetter , linux-amlogic@lists.infradead.org, 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). 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 Fri Feb 21 21:03:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397469 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 AC98917EF for ; Fri, 21 Feb 2020 21:04:52 +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 8AC37207FD for ; Fri, 21 Feb 2020 21:04:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HgbjxIyM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="YWfUF7sz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AC37207FD 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=2GME/mFvmY/Agn5SY8AnDMWQM8y9ROUnAW8Y+VMDAi0=; b=HgbjxIyMlj4SEo quUzDzVekI7sHABBDh29krJT3rFNNck9Akjo4I3M70MkbA5buItSdbd9trYNo7+AwUvONRYTf60ti 6LdHlsvjPdCULSEo0t+7Vur9IiV+SbdylKucjh5XgNJCf2C7It6jwV2DxC6bZtL6gZ3be3bFiAOPs g3HHPdSHTRkbWZgPtOuvCOeEsvf58Y3b97XZppMjfBb9yB9quJAS3LR9M+9OJKI5tkxZHKUb7CLN/ dhngn9uPdOUCmgXVzQLpSpo+BLCEeBywlZxaKkp+ZuN3kE4fHuGW3lF2G2GIdZST+xwv+vwa7kQl3 7wpHEqbi0hKPymmEGmEQ==; 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 1j5FTe-0000B8-Oi; Fri, 21 Feb 2020 21:04:50 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j5FTA-00087a-N1 for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2020 21:04:22 +0000 Received: by mail-wr1-x441.google.com with SMTP id u6so3560752wrt.0 for ; Fri, 21 Feb 2020 13:04:18 -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=qTbm0c/69CuYtL7h1VQBUhwKl0DAf2UFDhLQh32phtg=; b=YWfUF7szQfNkncc9THeB/wv2vks19mUCp6sc274w7Eie/qBZzHK84IaV6TMfmAKrk6 AcyWJsNuxiSWW8sUvkYwao7w0HjRjrm8fPdV2m3+phOzyhTBrazlZfT/ZZHW32u48ndh IEtAC0xkUNoFyLU9t8AIyT5LvMxjIh6F4NXuc= 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=qTbm0c/69CuYtL7h1VQBUhwKl0DAf2UFDhLQh32phtg=; b=XVbbMVuMtLMQ6XCtONd4tPSmqFcJwIRHtKcK3KJb3FGuT1EyQD+eUVvQhm6RKgPhqE tBBZbQc4Ss89yJvwYcwRhjg+7CvemyHM7oXXRBE8c0RQQZhx/NDSrs0kDL9gjS9fKL+f oZsyL2Ws0SrZk/JJ2crrawjeI6+2RoEfl6U30HhJewDuXv7IlD1AzxmW8uKjpyTeb55j K7r4NQjsYqlOHM+PUTnIlIpstsyjKdKAC/oLb69sfF6hX6P+Qm4Mvj1X42dayvbrOSba +OLCXlpKNHZk7/cfOI1B7Und5HgLvn6fhSaxX92j7I34jr6Fzhs2yHb7B7N8YcdD/+5a X+kQ== X-Gm-Message-State: APjAAAVpHGOfJMPlS0W+x6THTD423gsZSjkUfThkR2rsLFsGy7QPjQFR X081IZtdrctSeWLuXsukS3UA6w== X-Google-Smtp-Source: APXvYqy5XkSVwtYslV0K5isLENuIvM76ublN4PWtiJkQYmbtWq0CSLiXMpbngACLPz8J9+EeO3JOiA== X-Received: by 2002:adf:f507:: with SMTP id q7mr49558705wro.384.1582319057300; Fri, 21 Feb 2020 13:04:17 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z6sm5483930wrw.36.2020.02.21.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:04:16 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 37/51] drm/rockchip: Drop explicit drm_mode_config_cleanup call Date: Fri, 21 Feb 2020 22:03:05 +0100 Message-Id: <20200221210319.2245170-38-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> References: <20200221210319.2245170-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-20200221_130420_748547_282D7A21 X-CRM114-Status: GOOD ( 14.43 ) 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:441 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_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_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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?= , Daniel Vetter , Intel Graphics Development , Sandy Huang , linux-rockchip@lists.infradead.org, Laurent Pinchart , Daniel Vetter , 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). 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 | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 20ecb1508a22..d0eba21eebc9 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_free; rockchip_drm_mode_config_init(drm_dev); @@ -174,11 +176,8 @@ static int rockchip_drm_bind(struct device *dev) err_unbind_all: component_unbind_all(dev, drm_dev); err_mode_config_cleanup: - drm_mode_config_cleanup(drm_dev); 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 Fri Feb 21 21:03:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397427 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 152681580 for ; Fri, 21 Feb 2020 21:04:34 +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 D38352073A for ; Fri, 21 Feb 2020 21:04:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DBjux0zU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="JUcZUdSo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D38352073A 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=DBjux0zUxCNIHA 18DM9IusCC5EBP30QqjcE4Wd+s1RJS2mwvOK1tdoIheW0J0DoKjiKW/e3wq9iJSBUGwTkUD7q8Z7Q c3WaKs0GW6FXdG8EAo46lDXQ0Sw1SwcCoOWuQZraRohD3TZ3a9bnOWpzfdGDDbNp5RNt14Azl3/eA 5ByN53gJAQ9xXEbLCqXsiasFl4+s7v1iCN1hWdsZ6YmKhuu7l+JbqpPLlNTC1AoAdAM4FJuHI+Mjn SMPFA7vFpCVKszjatLbpGM/8uheQLzxV9q6isNxI4+dPl1aN3xw6xId2UtRi+2rMGW7gLRreDlKGI GRYR0135cXIjlm8fZkGA==; 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 1j5FTL-0008Io-O5; Fri, 21 Feb 2020 21:04:31 +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 1j5FTA-00087y-4H for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2020 21:04:21 +0000 Received: by mail-wm1-x343.google.com with SMTP id a5so3165540wmb.0 for ; Fri, 21 Feb 2020 13:04:20 -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=JUcZUdSolVLSScJmZ4pac+fLPoptZYAMcXTFnstu23DOwylMJ5O5W4taZWhttty3Mu hbyGk+GcTTVOoxC89GipeyReR/b6mHRz38H/WKGKCJeuHSflpn/4Di3is3fHSYWEbPAD CiAzZTvk3JxSwukoFtIRgCcNVmJfj9axPoURE= 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=QBG9Y8W431FnrbuMFUqeGJ98ODiuEeXEVRyvy2Fws2gK3uIY2xqulMzc5J0pZjhDFQ xwuGB+DqE1PdkFiKqd6Wf64IIPyaHgqGUMEIy3tm2sRzBu/Mh2+guxydmrcHQCHSZJvo Q2ZUHNQNX8+G7zsOWvKJNTrro9uXLR3oXpiCSJDreKyKSKjJVe5ruGj/hqPnq2iA1XBL 64uXMnZNIa8/kQJwILriEuJpZMc9DzFWcqZooHAeZAQPPIpA2oQ2ROjy/cgwVnh94785 kx7WmDqKgfBfhF9YFFdk9MLfBh2PsTfkASXNaTlzZuUsJXnOFIsyn+iPs+ruDfrMxLxM 9cxQ== X-Gm-Message-State: APjAAAVYjMGEeg+EmetMkFNaR6ch68ENGV6RiOdsU+jFbcsn5u8IvBOO OzOboZX536UBA3+vcQQm82NTHQ== X-Google-Smtp-Source: APXvYqxE6d0z/PJ8kwl5QVJU6aMhteu81Ji4eCz5l4YndZMRUkDhwPSabGxBRoO884TWZ32cbROk7Q== X-Received: by 2002:a1c:9602:: with SMTP id y2mr5536410wmd.23.1582319058948; Fri, 21 Feb 2020 13:04:18 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z6sm5483930wrw.36.2020.02.21.13.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:04:18 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 38/51] drm/stm: Drop explicit drm_mode_config_cleanup call Date: Fri, 21 Feb 2020 22:03:06 +0100 Message-Id: <20200221210319.2245170-39-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> References: <20200221210319.2245170-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-20200221_130420_167630_55834A23 X-CRM114-Status: GOOD ( 13.88 ) 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_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_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 , Yannick Fertre , Laurent Pinchart , Benjamin Gaignard , Daniel Vetter , Vincent Abriou , 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). 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)