From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7099FC35E17 for ; Thu, 27 Feb 2020 18:17:37 +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 4DBBE246B2 for ; Thu, 27 Feb 2020 18:17:37 +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="WDA3yw8i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DBBE246B2 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 0C3BE6ED32; Thu, 27 Feb 2020 18:16:36 +0000 (UTC) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DFBF6ECF0 for ; Thu, 27 Feb 2020 18:16:15 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id l5so4657539wrx.4 for ; Thu, 27 Feb 2020 10:16:15 -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=+nKgREY4pHUx8oiRsBupo7/g9tv+YIJYqnJ/ICqaTug=; b=WDA3yw8ipJ2LZEOgFgVlUKquD0WpdxcfOpPHjUdiZjoL/HoPNYB/tP4C8R/oLsuKZP RMcIYQOIuLputOGzX2LAwwvwq2RgW6fyKEniCEcpCtvzhCPpMnf+Y6HdVXUU4Qdy0y0V k0egCVWkTVp1SpAgHNwx5aBAUEeQKJtXvCehE= 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=+nKgREY4pHUx8oiRsBupo7/g9tv+YIJYqnJ/ICqaTug=; b=prGIEqIa6nXpnhskI4tyxRvaLp2K1FDbQzX1QJ5e2bKuvsGdPKfFQFTDYiUQ66f4vv 0CRSjwddaOcf6aZFpRoeEolRby8rUtlxpfYd/AkUPh+q0lch1fC+/pNUZZHc8lyJLrdI YHqP6GLxtGr4Ap2WJjJd24jruM0bzilQbxiezldA1RsPF28pCf7bB1PKqiFiKsDHBNf5 +m+TFGtzfozLKknKmg8h82uNdTepva6ixNRfC4CV1DY6nbdjJ/EFBfJAIL4Vyn1TfVAb Jl0uei/xEEGzQU0CUXVZ3pxyElaelHE1PHUe66NzvI1r9Vzx2sXyyQN/pGvughH7T+6w jgZA== X-Gm-Message-State: APjAAAVZFH7a7TIQ9bCeMDjguvWOABW5n0b+bnaq+km9+hPcqTy0K4yV oddHBP6lQ0sHUOzq3wyj4YnBW1o2AVc= X-Google-Smtp-Source: APXvYqzRtEAwIDLEML70F+9lKhjWkOXzJm0fi85zWbAfYpW3OiciBUxtlmJzBfQExtgDwfdyj9h1Ew== X-Received: by 2002:a5d:5007:: with SMTP id e7mr141208wrt.228.1582827373882; Thu, 27 Feb 2020 10:16:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:16:13 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 35/51] drm/pl111: Drop explicit drm_mode_config_cleanup call Date: Thu, 27 Feb 2020 19:15:06 +0100 Message-Id: <20200227181522.2711142-36-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-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: Daniel Vetter , Intel Graphics Development , m.felsch@pengutronix.de, Laurent Pinchart , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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). Cc: Laurent Pinchart Signed-off-by: Daniel Vetter Cc: Eric Anholt --- drivers/gpu/drm/pl111/pl111_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index aa8aa8d9e405..87b9b32c90a8 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -90,10 +90,13 @@ static int pl111_modeset_init(struct drm_device *dev) struct drm_panel *panel = NULL; struct drm_bridge *bridge = NULL; bool defer = false; - int ret = 0; + int ret; int i; - drm_mode_config_init(dev); + ret = drm_mode_config_init(dev); + if (ret) + return ret; + mode_config = &dev->mode_config; mode_config->funcs = &mode_config_funcs; mode_config->min_width = 1; @@ -154,7 +157,7 @@ static int pl111_modeset_init(struct drm_device *dev) DRM_MODE_CONNECTOR_Unknown); if (IS_ERR(bridge)) { ret = PTR_ERR(bridge); - goto out_config; + goto finish; } } else if (bridge) { dev_info(dev->dev, "Using non-panel bridge\n"); @@ -197,8 +200,6 @@ static int pl111_modeset_init(struct drm_device *dev) out_bridge: if (panel) drm_panel_bridge_remove(bridge); -out_config: - drm_mode_config_cleanup(dev); finish: return ret; } @@ -343,7 +344,6 @@ static int pl111_amba_remove(struct amba_device *amba_dev) drm_dev_unregister(drm); if (priv->panel) drm_panel_bridge_remove(priv->bridge); - drm_mode_config_cleanup(drm); drm_dev_put(drm); of_reserved_mem_device_release(dev); -- 2.24.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel