From patchwork Thu Mar 31 15:45:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1896 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BA7DE3F0D7 for ; Thu, 31 Mar 2022 17:45:30 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id y26-20020aa793da000000b004fb7c6f5d10sf5929402pff.1 for ; Thu, 31 Mar 2022 08:45:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648741529; cv=pass; d=google.com; s=arc-20160816; b=xLBICUiHqJOnJUMJKkJLTSFuVpMuhs8iMsW3CN5c1etxKFoWN9fqEZkXcrtkAAxfS1 9/pgccSSH4PYwRN4Cx4s47aW/7Es0lmkr8Je2it3SOX2CszM4gSX2M6mN3LNJxbFNII/ VJ7YsUI483tzVWgg2H+abvB9SgIxyKBCEuTxIKIfCxakQn+3z/6ZzkHEiYN1tP8fAuKZ Uz2BWgpwB+iRzbIdEbcu+v+bUaMomgIw0Ck/53i919U9pQqM/1iapDYj4YN8ZUPi7jxj Ze7BCVlkIKXM/cW6U73F97+5WloEcpH+GK5+xdUJZ/kUhTuuNt6c5n/POyCZ9ZVPgIS6 2uLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=d2NAPpWIStiJGH2Zt0jAP1aTYJXjVArEvAcC6QKcRoQ=; b=g79TXT4MyB17cddHXEegFtjVrulY1W5wnhRJgikZ+5iF6BUZwAWlvW0gY853uw7MQh Ze0gbkxLcvxdEnLHBAWASbHJusrDwAaGx4A/3ldEXwsWhuet6ADAlUozq6NaQDnaiqY/ RZZWehD9VuFJN1v0TQ/9siry+7UCqkLx4xjr8vCNMloT3A2I4gGxVAQz0OUy8dyeDxA1 ONjG6jR9Ys5pEKJtOJ3NmK0P8o/qsC0+g9/5qq8EJYxoKlMNWHCHHac6MPK0VfO/BrDY m8mZ+HUnPQDVLY8GKy9Bn71rjAes1F2S34/CTch3LFINkp/qmbFZUZsMAeqm95FmuGtG rZWg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pQu671AK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=d2NAPpWIStiJGH2Zt0jAP1aTYJXjVArEvAcC6QKcRoQ=; b=kyMwU9IEO4eFSKA5h+pby2gePdwRazir4iRtitopRjWCorg5NbPMNJ4Q7jaHqJ0L92 rzi+a5qXFJKS5RBT7xTYqZ/hzCz6QxNjG2KoxvF6wxTq11ZQ9Zyd3I/Y+Vj/VXkfHk5K fIUlDqv8GKL9jHYEPoiBo+arhERYV7ISU0ncI= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=d2NAPpWIStiJGH2Zt0jAP1aTYJXjVArEvAcC6QKcRoQ=; b=XQYRuJF0Hmj+Uf/KG9SfbptSbDPD2/DP88aT62kiiS98MK6CUngmxi3n1GfmGTU4ZJ KcFeJQunfs+aeisGowOgJD7nVnU/7V8Nqo7raH1/4x2kTToLSRtHeC3MO4brGCy08yxY YKhPzqN2hk+BR9J4N195SOKijc1Nop9zUB8La30xSdPNusZZ79NPZchsyXzUPqR9xQh5 hVc+XaWijYZ/iVgvlmO3gaZ10qclqupNMjX6ZtoTb8rlI0xw4TOQiVGWX2Lb1XnzGq0b IkSQVauTHocP3cmgpNwBnLhWX2QEm1NHiyIk0x6yEFgumiyPDn1ZeBpwO/Veh2jSwyRN +h1A== X-Gm-Message-State: AOAM5320r91Udt1BcRY1K8iy5wCdrUMY25D9JSAMJ2yfD0I0TRuAvttf WaGIvrJF3R5AGCxvCoyGWROAuPqm X-Google-Smtp-Source: ABdhPJzrC0u4cKJ8u58WeYjHsOqyFVmNp4WcT9QnbIDtPOkqTjdkhauYh5/Hqh2+icRMZl113JyVsA== X-Received: by 2002:a17:902:7482:b0:156:3489:88b3 with SMTP id h2-20020a170902748200b00156348988b3mr5976590pll.86.1648741529532; Thu, 31 Mar 2022 08:45:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:23c2:b0:4fa:698b:ecd with SMTP id g2-20020a056a0023c200b004fa698b0ecdls3038067pfc.8.gmail; Thu, 31 Mar 2022 08:45:29 -0700 (PDT) X-Received: by 2002:a63:e845:0:b0:385:f512:acbd with SMTP id a5-20020a63e845000000b00385f512acbdmr11343744pgk.196.1648741528734; Thu, 31 Mar 2022 08:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648741528; cv=none; d=google.com; s=arc-20160816; b=FPDim8aNw9TOpiSBdFszKEILUImb9yM87gfqdjxFVIQFL7CyK+safmaOL/Gntr+lj5 lEEyWhhMfEdh+wTKNay1gZU755vsY8lY0ixrg2TOLISy+QarQBIVqt3lA3nRE1MCUUP8 cd4zI6JtPIi2CtI2pmVmeddh7LJSs37dixu2LmZzpmfpNPxHltwBmjsh4zqLkzFH8gLd M+rgz6lLghPe/L1Sd8nQczZc8HipNI0uDU2SkF66DuItxdMpdMESuxRrw6TdEBfG7emS MFbt7fG2QS+qgvS8o6F4BaED3+gPnT9Api5+za5w8Lv28y/1CV8iL2DYvhnjW1tD+CYm swhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LV2sNThwuYoQaoZh1ko9r4mFVB8GTIqFM4DuqiJ9lj0=; b=AXOcsPth+7IZOd5DcqRQF5TY1PlLHmaqCYyMA93u1GLQkJxjXPSsSVAUi3AO5Mr71H r6ejVocGqEQsvvKI6asf95dpPIRazuRbX8FU7OPy7BaTwIVKiCTXyhJG5tBxXGrgwJ3E tGlQIDISa9XrzFUktJhREJbpJ65xRv7Qb3ayZ3+yEJwjCUfJSpKcQcfw+smkDadVYPpW JkJLmYbX/E94/+yEc/Jt9Gah5T5LYjQlHrcSaRiJehGVU3c3kdGfOXHet+p+51jvNyia KgaXMRomc8TXyKx0RJmolua0tibK8ihGTjGk9XCozZFC+8LeVhOIkmGDXN2cvQaFvqfn pNvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pQu671AK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u9-20020a056a00098900b004fa9ab46a7fsor10454204pfg.13.2022.03.31.08.45.28 for (Google Transport Security); Thu, 31 Mar 2022 08:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a62:cd83:0:b0:4fa:7410:6d86 with SMTP id o125-20020a62cd83000000b004fa74106d86mr40405669pfg.52.1648741528412; Thu, 31 Mar 2022 08:45:28 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id g1-20020a17090adac100b001c67cedd84esm10205684pjx.42.2022.03.31.08.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 08:45:27 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart Cc: Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki , Chun-Kuang Hu , Philipp Zabel Subject: [PATCH v4 3/5] drm: bridge: mtk_dsi: Switch to devm_drm_of_get_bridge Date: Thu, 31 Mar 2022 21:15:01 +0530 Message-Id: <20220331154503.66054-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220331154503.66054-1-jagan@amarulasolutions.com> References: <20220331154503.66054-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pQu671AK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Robert Foss --- Changes for v4, v3: - none 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 e91b3fff4342..1487cc308c5d 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1016,7 +1016,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; @@ -1033,17 +1032,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);