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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 41734C433EF for ; Wed, 22 Jun 2022 14:32:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E6601123C6; Wed, 22 Jun 2022 14:32:34 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0D4A1123CE for ; Wed, 22 Jun 2022 14:32:32 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8E343320090E; Wed, 22 Jun 2022 10:32:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 22 Jun 2022 10:32:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1655908351; x=1655994751; bh=Ap ADr6udxfVbbIuJ9jHo5Or6X160AvsQoECS97UrOM0=; b=QnNPRvhBWHDzmKwz9P VzZ9hpeIwA/u+0NUt+n+PCK68lttZV6vQ3Tvcocj/+110anW+LYBDwEvKbSWXoVf tkv20BJc+PIetABLs/5FLrJJmlet1ADln+T42TSuLfVXeZ6W6geycfzO7d4fazkG UC8Vjci7DGAyk2gUA1e+L7aRIwKTBzsszB3aSytjbzqt3uh7yxQ5b1bRuQxQFTl4 mf46EmDRsNgFh1nh8jLj1IsEnjCtXrZSACWP5H8vsfBZh2ciQP4j1vGCzUS3Jg4W 17K2vN/HyHiTEkedrHGN34DIVwvZxlwV7+fFAiTPgRQOcpWh83TKB4/uuHsbkHkg VpVQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1655908351; x=1655994751; bh=ApADr6udxfVbb IuJ9jHo5Or6X160AvsQoECS97UrOM0=; b=YjvyZRyXlvdXW/7ltZjkhh5btnJPv +5loYpQm6OCJJETXFMffW6UX5xRa/HZA6AbpZaCUP8cKxeoHU7S1ZvJ2uGn+2AD5 OKmb7BC7P+U6LvvDZx3JMPE7x5k3gQHe7Q4Qc58xLIuYX9/wpoV/XUnDgyGcJors LHAGjzYqAl4pqNdlCJgdjELIbyw8PQC+IYRiTiacDYPAtvTFo5PUtR8oYO/miWbV OQ0d5UATlO3C5uGjE4IetUGnHz75EKk6urXQlUwJJgiB6yp/AODQTyMYqdil+rUt SBHClq2nS1Fj+Loetq7emkJ7nKUnAbfWTZkLUwEJllrV4F26+IlZcderQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefhedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelkeefteduhfekjeeihfetudfguedvveekkeetteekhfekhfdtlefgfedu vdejhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jun 2022 10:32:30 -0400 (EDT) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Subject: [PATCH v2 05/68] drm/connector: Mention the cleanup after drm_connector_init Date: Wed, 22 Jun 2022 16:31:06 +0200 Message-Id: <20220622143209.600298-6-maxime@cerno.tech> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622143209.600298-1-maxime@cerno.tech> References: <20220622143209.600298-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Unlike encoders and CRTCs, the drm_connector_init() and drm_connector_init_with_ddc() don't mention how the cleanup is supposed to be done. Let's add it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 353d83ae09d3..f0c4665caf38 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -222,6 +222,10 @@ void drm_connector_free_work_fn(struct work_struct *work) * Initialises a preallocated connector. Connectors should be * subclassed as part of driver connector objects. * + * At driver unload time the driver's &drm_connector_funcs.destroy hook + * should call drm_connector_cleanup() and free the connector structure. + * The connector structure should not be allocated with devm_kzalloc(). + * * Returns: * Zero on success, error code on failure. */ @@ -345,6 +349,10 @@ EXPORT_SYMBOL(drm_connector_init); * Initialises a preallocated connector. Connectors should be * subclassed as part of driver connector objects. * + * At driver unload time the driver's &drm_connector_funcs.destroy hook + * should call drm_connector_cleanup() and free the connector structure. + * The connector structure should not be allocated with devm_kzalloc(). + * * Ensures that the ddc field of the connector is correctly set. * * Returns: -- 2.36.1