From patchwork Fri Feb 21 21:03:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397459 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 B7B421580 for ; Fri, 21 Feb 2020 21:04:49 +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 95A712073A for ; Fri, 21 Feb 2020 21:04:49 +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="dZvQAWtJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95A712073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A625E6F552; Fri, 21 Feb 2020 21:04:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A4306F546 for ; Fri, 21 Feb 2020 21:04:11 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id p17so3311056wma.1 for ; Fri, 21 Feb 2020 13:04:11 -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=iLLeF/pcS2m0P07OactkBBXJHNqJyrXQylwma878fiQ=; b=dZvQAWtJrTUdGkd8z7Pky417+Nnqxp/a8eptR5aka3oVE7lvIqxcRSXIHB2Z4Z4nCC n5rjrEnwgLzeOUZTELlCoUpVeccx9y9x5nXaXvlaB5Ef3CaPYQYWEdoo/NXx6Wsh3ucT Q5I/Wy1kFXU9EssCdZnIvpALdLcPZFpHtXq98= 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=iLLeF/pcS2m0P07OactkBBXJHNqJyrXQylwma878fiQ=; b=Tqq2p1neurL3k7BamJsFL57NHwJDGBKBw2Tqmfs9ctDuggrBJAcex2Qi1FCeUO+8me gapJHSBFqFi05siF4/Hf6vdVImciGqLVOTNEr8SnxbMEipueLObvSNVlNqfHiOzlKJbV nKiK2rtojwvhRNgSxvK0lIeNDQTYUO6b6W8DyVP21sssU0i99oyq50lhcIT5bnVcNwnV iUbOY2LoY4cJUXRyGFlreimX/OXKycMkU5ry+k00svTgGe7c790lznSJBx7X9Caq/tRg E4h4aYX5u8RkDCwedATKYHDBuu4QoU5NiXdDfnx/pV35S6pzdzZAUy6t76DQ1CuDkvUZ n5dw== X-Gm-Message-State: APjAAAUu3K/dJYWCwj+T0S0L7AHCB4N+bibHRfpjxdOgJPNMv5FUyIm6 gEDo5wnlJfrvSAHjctSMKEbhvA== X-Google-Smtp-Source: APXvYqz7dZJWx7G0kOHGWOrmVMdb0fOabNyOcClFP590NPvcxEkIoGn3zNaGySAL6Z/6gemdvDeZMA== X-Received: by 2002:a7b:c8d2:: with SMTP id f18mr5391751wml.47.1582319049997; Fri, 21 Feb 2020 13:04:09 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:04:09 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Fri, 21 Feb 2020 22:03:00 +0100 Message-Id: <20200221210319.2245170-33-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 Subject: [Intel-gfx] [PATCH 32/51] drm/mcde: Drop explicit drm_mode_config_cleanup call X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter , Intel Graphics Development , Linus Walleij , Laurent Pinchart Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Allows us to drop the drm_driver.release callback. 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(). v2: Explain why this cleanup is possible (Laurent). Reviewed-by: Linus Walleij Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Linus Walleij --- drivers/gpu/drm/mcde/mcde_drv.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index a543ebf3d541..b8ca99995e51 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -184,13 +184,13 @@ static int mcde_modeset_init(struct drm_device *drm) ret = drm_vblank_init(drm, 1); if (ret) { dev_err(drm->dev, "failed to init vblank\n"); - goto out_config; + return ret; } ret = mcde_display_init(drm); if (ret) { dev_err(drm->dev, "failed to init display\n"); - goto out_config; + return ret; } /* @@ -204,7 +204,7 @@ static int mcde_modeset_init(struct drm_device *drm) mcde->bridge); if (ret) { dev_err(drm->dev, "failed to attach display output bridge\n"); - goto out_config; + return ret; } drm_mode_config_reset(drm); @@ -212,17 +212,6 @@ static int mcde_modeset_init(struct drm_device *drm) drm_fbdev_generic_setup(drm, 32); return 0; - -out_config: - drm_mode_config_cleanup(drm); - return ret; -} - -static void mcde_release(struct drm_device *drm) -{ - struct mcde *mcde = drm->dev_private; - - drm_mode_config_cleanup(drm); } DEFINE_DRM_GEM_CMA_FOPS(drm_fops); @@ -230,7 +219,6 @@ DEFINE_DRM_GEM_CMA_FOPS(drm_fops); static struct drm_driver mcde_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, - .release = mcde_release, .lastclose = drm_fb_helper_lastclose, .ioctls = NULL, .fops = &drm_fops, @@ -258,7 +246,9 @@ static int mcde_drm_bind(struct device *dev) struct drm_device *drm = dev_get_drvdata(dev); int ret; - drm_mode_config_init(drm); + ret = drm_mode_config_init(drm); + if (ret) + return ret; ret = component_bind_all(drm->dev, drm); if (ret) {