From patchwork Mon Oct 25 15:15:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12582109 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2429EC43217 for ; Mon, 25 Oct 2021 15:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C2C760F92 for ; Mon, 25 Oct 2021 15:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233617AbhJYPS0 (ORCPT ); Mon, 25 Oct 2021 11:18:26 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:37003 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233097AbhJYPSX (ORCPT ); Mon, 25 Oct 2021 11:18:23 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0EECC5806B0; Mon, 25 Oct 2021 11:16:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 25 Oct 2021 11:16:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=Z7ANxwSCuwS0R URLyvuze3uqYVQmNE0MSkpaXoK8tPE=; b=lrLNFA1Vstcpm9VyxaiJVSWyu17AN tRP5pPCm1GnQO4pW/Xdf9MTBUAD/MGrlzVifez0Ra0iJZyLY256gTYtDU9HZtWUC 70slgGnrYHqx+1QAxXtLKOVBd17kudsLt01LaAEFlkAPExyo3iq+Z06R8NvUZ6ag vSERMbxXl7uZMlZXoNukNF6xheaA3+1www9lcAETz4p0Bos6VH1ANCAxOXX9wy4/ uu46tGjh6kFVL1UO1656Nu6G0FIOBts7Ry6/0Ao86x2q2O6qr0LSeMj4UWkhIVPS UJ22wm8MPDksIlJEbhjnDsRBhIYNPDkOh3MrMFT/N8MSlsTSHKWKl/4mA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=Z7ANxwSCuwS0RURLyvuze3uqYVQmNE0MSkpaXoK8tPE=; b=g6SZc2xU CKtectEAIxdawUW7z8v7UYLFe6C5MG9X53x8wtaszUJtajPqVNmS1sxmxTY/dqwS dBKNIh1FCfhpdh66KbOuH5DIqZM+w2/9ADd2gh/FjKaVtCgt/6Z/b85nMbRrCfUu IYvSnHaUeSgfD0LF3/uPKQpConhvhf6WAB+DQvOEV/FSCeKgDX799zq5jwN7OVVz Bb7lYHYnZF+d0U6WRoi/0YSPsrcHiJa+ZzZ1YSgxaN3k29eFKst4C6u7bZPZPM0Y QVLpJKgCi8uTJZlrbu5M2R8NSlnvbKvVqLvIBASIka1StQxkPuVjGfslDelzHqnY q0tQYLR/UdHhDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 11:16:00 -0400 (EDT) From: Maxime Ripard To: Thierry Reding , Laurent Pinchart , Andrzej Hajda , Robert Foss , Jonas Karlman , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Jernej Skrabec , Sam Ravnborg , Neil Armstrong Cc: Seung-Woo Kim , linux-arm-msm@vger.kernel.org, Joonyoung Shim , Rob Clark , Tian Tao , Chen Feng , Xinwei Kong , Kyungmin Park , linux-samsung-soc@vger.kernel.org, Xinliang Liu , John Stultz , linux-kernel@vger.kernel.org, Inki Dae , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Sean Paul Subject: [PATCH v6 07/21] drm/bridge: lt9611: Switch to devm MIPI-DSI helpers Date: Mon, 25 Oct 2021 17:15:22 +0200 Message-Id: <20211025151536.1048186-8-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211025151536.1048186-1-maxime@cerno.tech> References: <20211025151536.1048186-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. Acked-by: Sam Ravnborg Tested-by: John Stultz Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/lontium-lt9611.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 29b1ce2140ab..654131aca5ed 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -760,6 +760,7 @@ static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, const struct mipi_dsi_device_info info = { "lt9611", 0, NULL }; struct mipi_dsi_device *dsi; struct mipi_dsi_host *host; + struct device *dev = lt9611->dev; int ret; host = of_find_mipi_dsi_host_by_node(dsi_node); @@ -768,7 +769,7 @@ static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, return ERR_PTR(-EPROBE_DEFER); } - dsi = mipi_dsi_device_register_full(host, &info); + dsi = devm_mipi_dsi_device_register_full(dev, host, &info); if (IS_ERR(dsi)) { dev_err(lt9611->dev, "failed to create dsi device\n"); return dsi; @@ -779,29 +780,15 @@ static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO_HSE; - ret = mipi_dsi_attach(dsi); + ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { - dev_err(lt9611->dev, "failed to attach dsi to host\n"); - mipi_dsi_device_unregister(dsi); + dev_err(dev, "failed to attach dsi to host\n"); return ERR_PTR(ret); } return dsi; } -static void lt9611_bridge_detach(struct drm_bridge *bridge) -{ - struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - - if (lt9611->dsi1) { - mipi_dsi_detach(lt9611->dsi1); - mipi_dsi_device_unregister(lt9611->dsi1); - } - - mipi_dsi_detach(lt9611->dsi0); - mipi_dsi_device_unregister(lt9611->dsi0); -} - static int lt9611_connector_init(struct drm_bridge *bridge, struct lt9611 *lt9611) { int ret; @@ -855,9 +842,7 @@ static int lt9611_bridge_attach(struct drm_bridge *bridge, return 0; err_unregister_dsi0: - lt9611_bridge_detach(bridge); drm_connector_cleanup(<9611->connector); - mipi_dsi_device_unregister(lt9611->dsi0); return ret; } @@ -952,7 +937,6 @@ static void lt9611_bridge_hpd_enable(struct drm_bridge *bridge) static const struct drm_bridge_funcs lt9611_bridge_funcs = { .attach = lt9611_bridge_attach, - .detach = lt9611_bridge_detach, .mode_valid = lt9611_bridge_mode_valid, .enable = lt9611_bridge_enable, .disable = lt9611_bridge_disable,