From patchwork Tue Mar 1 14:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764763 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 B34E7C4332F for ; Tue, 1 Mar 2022 14:13:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E89B10E8A0; Tue, 1 Mar 2022 14:13:13 +0000 (UTC) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B8B910E898 for ; Tue, 1 Mar 2022 14:13:12 +0000 (UTC) Received: by mail-pl1-x62f.google.com with SMTP id c9so13567423pll.0 for ; Tue, 01 Mar 2022 06:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RfOD5os58Zi+V6L7F7QFRD9/WvrhIP6GUWjSjvrBko0=; b=oayZNfVCkp9Ck5hqbCvOUvjyCdLRtKvX6dkRHEZ1tpsCb5hqDFhySGxIuvTYU7qpPd H1ESQMkFhGTWF1JvsWxWpsMvbKkgoDP3GhezERhlxG0EP17h/qMAo/WXe+98Q+iZAbrH qphSxJ6yRU6dvn0Uq94lGdA7dCXwCwrzgfciA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RfOD5os58Zi+V6L7F7QFRD9/WvrhIP6GUWjSjvrBko0=; b=i+3Am4slXxQqzC6LK5gUaLGT0CPSjtWuUmOlRz2vOVoHGqNA8id7MTmq6a1BLS3Mbj 1X4IlOOhHLVmudu5zIpML7cxPYuoW6oiyef3qGPv3y/WygTlMCRiJBkE4PKo8RfSgZ+d bJ1FWLRHXUzSM3m4dZDP4YC7hT8+kyjk0UDvttfk+mEkcaQVmapiz+o7u4cnDGbv1HwP t3hBKLrUENVSWEcadgTEzQ+NDUj1qglcKGIz9DjO3uE5Y8m1vM8OxzYTF7ubrkme4S9d Ir/EpyoHVv0Jyd6MQM1ALjW09ozWEBfxtV9atFsoyb7CdHLQRHgVkAZAzcTINNx6/6Y8 aLBg== X-Gm-Message-State: AOAM530boXAP7Ar5/wstG63/NcGinbFJRFau8QgklvNXAiuPJwQdS3ui BNizXBsKMH4yutGDjFWbHpSDmQ== X-Google-Smtp-Source: ABdhPJyN9KR62eGDLOHk3LNaWXU6a/yqaexKMuhd/Uj4PoOLneGSQlVZPl7xkQXv5FbiDBTU09u+SQ== X-Received: by 2002:a17:902:aa86:b0:14d:a4aa:e6f5 with SMTP id d6-20020a170902aa8600b0014da4aae6f5mr25940900plr.8.1646143991572; Tue, 01 Mar 2022 06:13:11 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:11 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 3/8] drm: mediatek: mtk_dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:42 +0530 Message-Id: <20220301141247.126911-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> 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: Chun-Kuang Hu , linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Chun-Kuang Hu Cc: Philipp Zabel Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/mediatek/mtk_dsi.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 5d90d2eb0019..a1b3e1f4b497 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1004,7 +1004,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) { struct mtk_dsi *dsi; struct device *dev = &pdev->dev; - struct drm_panel *panel; struct resource *regs; int irq_num; int ret; @@ -1021,17 +1020,10 @@ static int mtk_dsi_probe(struct platform_device *pdev) return ret; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, - &panel, &dsi->next_bridge); - if (ret) + dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); + if (IS_ERR(dsi->next_bridge)) { + ret = PTR_ERR(dsi->next_bridge); goto err_unregister_host; - - if (panel) { - dsi->next_bridge = devm_drm_panel_bridge_add(dev, panel); - if (IS_ERR(dsi->next_bridge)) { - ret = PTR_ERR(dsi->next_bridge); - goto err_unregister_host; - } } dsi->driver_data = of_device_get_match_data(dev);