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: 11397471 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 355B617F0 for ; Fri, 21 Feb 2020 21:04:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 142E92073A for ; Fri, 21 Feb 2020 21:04:53 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 142E92073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFDD66F51D; Fri, 21 Feb 2020 21:04:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEDF66F53E for ; Fri, 21 Feb 2020 21:04:14 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id b17so3318999wmb.0 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=WAAW8XBHWVDN9kZCgwTdPRBEZSmdSBOWC6BORe66Z/mRtrLRF11JmfMNNspCuuc6Va 3iEvcAS2LOErnMAww2Ez0F/OETmhSGN/5n4WyiaiiTXYCWSlbUAf/DQHZRalYgDM3Le6 gAsbbshFqX0uut654sKWNPlIlRjx4H5f8KvQHnf0jDP7y8IuvM5i+/73W6a9GNKoEMUA Uc18PiDmXnYoRx+6I65KjhlJakKJTm4Vq+tQTHFVtL3AEY/nH4sSKAfVkAxBECVczH+z Y3iBZyFpilM5YIcbC0Lhg1srQgct3v5g2QOMembK5yKSEbK+gYqlaOqnEZfBm0NSS+tK o49w== X-Gm-Message-State: APjAAAUFYmTdggDmBsvCHemF19Q0FIMaEXGBriVWXwldTrhsPt7lm+a2 HyKn4O5t9AEMKXJlbw+Nf3Mbv1yHHHc= 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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); }