From patchwork Sat Jul 9 14:48:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12912246 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 922CCC433EF for ; Sat, 9 Jul 2022 14:48:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14F2010F684; Sat, 9 Jul 2022 14:48:44 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB3E910F682 for ; Sat, 9 Jul 2022 14:48:41 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1CDAA845E3; Sat, 9 Jul 2022 16:48:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657378120; bh=0zrQ6GD2zG3NCklZYU8acqqFAbaDs7HNGn9HLBmlFD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvwVDcC1Q/NTwT4sOhNx0yQwjjQ0F9w5LUS9Ql7Ve+4IISougWPAooe2DOCdDH+CP POmMg4ZVkTHQd3sZI+sOxHJD1hZU2CFL+ubc4RrnhvBZ86e+3htPX969Z/vhiO87XF 6X91JIg0wHtvqrZAMW/Kzzie7jCMExCKKpE31XYwEOWO+BiUOcudcUsUD0NEWv5Tfu VNQYIhWSv1kMrLNYMKX0zwZU8CqhWIO8OMDGFRbWLEpDCCjT29Y56ARW/qEwnv3ydj aCRQH47PdSxftYvbZwYULVnaMDZvkVDQSVj2gmxKSf38xA3JhZ0FLmf72wAQa+TXGn lwWqprmlPlo2A== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 4/4] drm/lcdif: switch to devm_drm_of_get_bridge Date: Sat, 9 Jul 2022 16:48:26 +0200 Message-Id: <20220709144826.9278-4-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220709144826.9278-1-marex@denx.de> References: <20220709144826.9278-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Liu Ying , robert.foss@linaro.org, Liu Ying , Alexander Stein , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu V3: Add TB from Martyn from V1 --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 1370889c6d687..746a4261f3da2 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -42,23 +42,11 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct drm_device *drm = lcdif->drm; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; - ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, - &bridge); - if (ret) - return ret; - - if (panel) { - bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, - DRM_MODE_CONNECTOR_DPI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - if (!bridge) - return -ENODEV; + bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0); if (ret)