From patchwork Fri Sep 10 10:12:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 508797 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 5A67CC433F5 for ; Fri, 10 Sep 2021 10:14:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45FEF6108B for ; Fri, 10 Sep 2021 10:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbhIJKPO (ORCPT ); Fri, 10 Sep 2021 06:15:14 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:45081 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232734AbhIJKPE (ORCPT ); Fri, 10 Sep 2021 06:15:04 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 4D8A22B013E3; Fri, 10 Sep 2021 06:13:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 10 Sep 2021 06:13:53 -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=fm3; bh=ElwsU250aG/tu 9y6tqB4Q8NGUP8iiIiI7vQRc+08/+w=; b=VF2K0F/P2QiCc1Cs8Q+aI+t6kNyiV tmWi6oryyVsvBvTYIhar+XpYdpwmFYoQrDbbsd6s5x1bJZnW3/kNQxDeVSsWGMoJ z07CtEcYLcNuUZxRnshPwfw6ssK4uZXqJ3NhAYVFxw+hALCpW/nPJyiW37hxZaa5 4tcrwTcatkqVYERWDPEazgcHreEXq/1BmVRBklGsE3Y+Ah3MRkTkHTBFVU8UuSPY yZeWv75jiHIMdB0O7Uwm4XdPnrRqYTS/X4cjRORBxxbdpq2sY8tkcfkLGeocpc4V 05eD4f7vTqAH3mebp/Re55GEhqcgwhiafmZiPBYRG39QPCW5pGcerH4BA== 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= fm3; bh=ElwsU250aG/tu9y6tqB4Q8NGUP8iiIiI7vQRc+08/+w=; b=kEExk7L/ 9bf2Zp2eRTdaShQkrhIidnZCMkBXPZ4mv+jCZ83BUqPtGDfgq5be4U+PpwP1AEUo sY9vIn4aGylNa/3b6syKjgcoCFecfxoE9y0BXWclWDmMjM3nibvbfaqH0Flnu3mc JW8U8loQ0cdV6CAHG6HjHTjy2zOzB/plhWA/eIiX+CGeScRfMBepRKNtncgPhG+n 0TESBpuX6cZqz4P35vOgOIITt8djZtYfY7XcsJGQBTUZ8P/r0EVjXeLuEfC0XTVy rWOgqs/MgVFnm4nsD3fc9I9LLtLCghIoPBiks50CsuEjLcLgWKCYGZ9MxT69wvmz ZiclNzS7+VJTJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeguddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 06:13:48 -0400 (EDT) From: Maxime Ripard To: Andrzej Hajda , Sam Ravnborg , Daniel Vetter , David Airlie , Jonas Karlman , Laurent Pinchart , Thierry Reding , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Neil Armstrong , Robert Foss , Jernej Skrabec Cc: Sean Paul , freedreno@lists.freedesktop.org, Kyungmin Park , linux-kernel@vger.kernel.org, Xinliang Liu , Seung-Woo Kim , Tian Tao , Inki Dae , linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rob Clark , dri-devel@lists.freedesktop.org, John Stultz , Chen Feng , Xinwei Kong , Joonyoung Shim Subject: [PATCH v4 15/24] drm/bridge: ps8640: Switch to devm MIPI-DSI helpers Date: Fri, 10 Sep 2021 12:12:09 +0200 Message-Id: <20210910101218.1632297-16-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210910101218.1632297-1-maxime@cerno.tech> References: <20210910101218.1632297-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. This also avoids leaking the device on removal. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/parade-ps8640.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c index 685e9c38b2db..c943045f3370 100644 --- a/drivers/gpu/drm/bridge/parade-ps8640.c +++ b/drivers/gpu/drm/bridge/parade-ps8640.c @@ -243,7 +243,7 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge, if (!host) return -ENODEV; - dsi = mipi_dsi_device_register_full(host, &info); + dsi = devm_mipi_dsi_device_register_full(dev, host, &info); if (IS_ERR(dsi)) { dev_err(dev, "failed to create dsi device\n"); ret = PTR_ERR(dsi); @@ -257,17 +257,13 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge, MIPI_DSI_MODE_VIDEO_SYNC_PULSE; dsi->format = MIPI_DSI_FMT_RGB888; dsi->lanes = NUM_MIPI_LANES; - ret = mipi_dsi_attach(dsi); + ret = devm_mipi_dsi_attach(dev, dsi); if (ret) - goto err_dsi_attach; + return ret; /* Attach the panel-bridge to the dsi bridge */ return drm_bridge_attach(bridge->encoder, ps_bridge->panel_bridge, &ps_bridge->bridge, flags); - -err_dsi_attach: - mipi_dsi_device_unregister(dsi); - return ret; } static struct edid *ps8640_bridge_get_edid(struct drm_bridge *bridge,