From patchwork Wed Feb 19 10:21:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11391161 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 F0AC41580 for ; Wed, 19 Feb 2020 10:23:56 +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 CFD9024677 for ; Wed, 19 Feb 2020 10:23:56 +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="QR6eBcxA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFD9024677 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 DD2496EBA0; Wed, 19 Feb 2020 10:23:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DD406EB37 for ; Wed, 19 Feb 2020 10:22:32 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id u6so27603191wrt.0 for ; Wed, 19 Feb 2020 02:22:31 -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=5l4b2TzFxj13a9gF/hefgYjp+ixSKuPIEzJSuPD5Vdg=; b=QR6eBcxAuWmgI5SpKVzerxl0wg1wjtPoCiM67gTMIYIsv6p0v57wIk3GI46+qro8E3 Ga3rO1E2tymAl4ebfdbkvsMvPl5MFYvnkykizHinHQQCvLcgHm1ySLTBhvjkWvIawmSH NGZXzqQuzvsTitrKke6Ibweb0BEuw5JZ0CM5U= 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=5l4b2TzFxj13a9gF/hefgYjp+ixSKuPIEzJSuPD5Vdg=; b=e0jl/vf21wPutRmDinBWgvqTcUnR+67U6o/tm/6ZtrefG8yT7DaPOLQ51/WNXnukQV uYSyGEaUlbk9iC4Pg14SrV6FtkdL4gK7P6h64WQJlikrJrnKvkDEtkd7RxDcxuUDGrdo n3qwCEK8AdJhvYfVvK/2j9jgiDYFPpZCGACWArYY1Who4j+jREOyBswCDIVFN853B/F/ 5fkJkArv6Zulq3R4icgnhNs6OT4Yvv/je/Uh6Gt40GiIdAnKZmpwDiBE04wR5YcJUs8m 14dQXf0evy8mqpX7ocEsUHynBWg01TzucaqMU8MicRlFcZxwyv61kRHi5xbTDJQXgXMB pX8g== X-Gm-Message-State: APjAAAUboX/egAGrMmMj1qdN2NtOAfqgrzEsTijLp+Y+rM4yAc5ub+4e 7Nq3wrXkkQg2uFrk55izxcsZK42Wu6o= X-Google-Smtp-Source: APXvYqy5hmgMt5f7p4jAqmJHX5pAVS7sDYPzws1v19cXaqPPiXmkjaLkS1uSVl4WfiaodSlvJmVb4Q== X-Received: by 2002:a5d:5452:: with SMTP id w18mr33451326wrv.333.1582107750414; Wed, 19 Feb 2020 02:22:30 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s23sm2370339wra.15.2020.02.19.02.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 02:22:29 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 50/52] drm/udl: Drop explicit drm_mode_config_cleanup call Date: Wed, 19 Feb 2020 11:21:20 +0100 Message-Id: <20200219102122.1607365-51-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200219102122.1607365-1-daniel.vetter@ffwll.ch> References: <20200219102122.1607365-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: Sam Ravnborg , Daniel Vetter , Intel Graphics Development , Emil Velikov , Gerd Hoffmann , Thomas Zimmermann , Daniel Vetter , Dave Airlie , Thomas Gleixner , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It's right above the drm_dev_put(). This allows us to delete a bit of onion unwinding in udl_modeset_init(). Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Sean Paul Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Gerd Hoffmann Cc: "Noralf Trønnes" Cc: Thomas Gleixner Cc: Sam Ravnborg --- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/udl/udl_drv.h | 1 - drivers/gpu/drm/udl/udl_modeset.c | 21 ++++++--------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index 8b78c356beb5..b447fb053e78 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c @@ -37,7 +37,6 @@ DEFINE_DRM_GEM_FOPS(udl_driver_fops); static void udl_driver_release(struct drm_device *dev) { udl_fini(dev); - udl_modeset_cleanup(dev); } static struct drm_driver driver = { diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h index e67227c44cc4..1de7eb1b6aac 100644 --- a/drivers/gpu/drm/udl/udl_drv.h +++ b/drivers/gpu/drm/udl/udl_drv.h @@ -68,7 +68,6 @@ struct udl_device { /* modeset */ int udl_modeset_init(struct drm_device *dev); -void udl_modeset_cleanup(struct drm_device *dev); struct drm_connector *udl_connector_init(struct drm_device *dev); struct urb *udl_get_urb(struct drm_device *dev); diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index d59ebac70b15..cad0c87f8de6 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -468,7 +468,9 @@ int udl_modeset_init(struct drm_device *dev) struct drm_connector *connector; int ret; - drm_mode_config_init(dev); + ret = drm_mode_config_init(dev); + if (ret) + return ret; dev->mode_config.min_width = 640; dev->mode_config.min_height = 480; @@ -482,10 +484,8 @@ int udl_modeset_init(struct drm_device *dev) dev->mode_config.funcs = &udl_mode_funcs; connector = udl_connector_init(dev); - if (IS_ERR(connector)) { - ret = PTR_ERR(connector); - goto err_drm_mode_config_cleanup; - } + if (IS_ERR(connector)) + return PTR_ERR(connector); format_count = ARRAY_SIZE(udl_simple_display_pipe_formats); @@ -494,18 +494,9 @@ int udl_modeset_init(struct drm_device *dev) udl_simple_display_pipe_formats, format_count, NULL, connector); if (ret) - goto err_drm_mode_config_cleanup; + return ret; drm_mode_config_reset(dev); return 0; - -err_drm_mode_config_cleanup: - drm_mode_config_cleanup(dev); - return ret; -} - -void udl_modeset_cleanup(struct drm_device *dev) -{ - drm_mode_config_cleanup(dev); }