From patchwork Tue Mar 1 14:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1853 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B5F7D3F0D5 for ; Tue, 1 Mar 2022 15:13:31 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id w3-20020a17090ac98300b001b8b914e91asf1723572pjt.0 for ; Tue, 01 Mar 2022 06:13:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646144010; cv=pass; d=google.com; s=arc-20160816; b=zkT/qPkDztOoA2VTigV8NfGs3MwQ78d8VQgrkhumeOnfBPJfkDXvOSQ2WMGdZTh0ve E3Y1qKc5R8i7+ELRmNLAMrcBcohVQW0aefKhAtboOOshlMpTBO6RK7niTwnLnbpu8v+R s/Qrs1rbHjem1xh4TAGRECOH3uDKzokDDy8X49G0gflGYtGpjjbBLQHIOvsKOgwX6Jxr jxKrVPYOJcWRyDTYsSHK3/g+kI0U8Lbxp7reJeNs1OdSbvORKXPU2gqO+9f52dNZhMi6 ezsMBTMy3zJEZXANN79Gnx6isWyToCz3xSnn01sRAwoGTiLkAKZtPrYmoi/hd2nlDOSV gmgA== 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=01/BpWlaAfcvvTKfpvDaLdngvIaVo2sT2hJjpRvU6+0=; b=pmEfwv8TOBOk1hoUUd/LQeural2tEEtHwCuBskpJ1jqLrULyP9wKSkFQuVlt4/huwW UHHN8HFsE8unUkVhP5fSREti05WA3CfLBRgkQRt83rNgJiB2P+jeeOcYUTBoL7F1uc8f iuydv6x+CNfaXyCrQdYzpGN5rdCxxZLGYvv2I2htu4wFCNr343nBDSqFXVO4TzXs/k8q lqfF/x2G+LSPIXBXgY24A3Cxvww87Mqgf81GW2Dzoq8hftn24DfhuKunY7MpuwiBGYAP Opd52fnykPGEyMP+oy2bYWpkWMAqlKyHC4I02HqmYsdJUMPs6WSWjTY9dWIuGnE1ZJn4 gkSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RwZ6EPrZ; 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=01/BpWlaAfcvvTKfpvDaLdngvIaVo2sT2hJjpRvU6+0=; b=rg5vMemUfOiIqxNSxJoNi1Uxig3CpjEzq1rMNsvIN78ZKWjoJJjbDwb8vY6BU0ZPkQ IkkM3pwmDkOhZjCqiR0v0+vPfd15DFL6cXVLqsfd6Ma7KereRie8U5gloEJQzHlxAKhU Q2lmMgmXdpC+Uo/huv58I3cBdgpOzUYb7h0RM= 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=01/BpWlaAfcvvTKfpvDaLdngvIaVo2sT2hJjpRvU6+0=; b=IfukCnt+fn+iJ2JxuHL6mYgxlpmhZfJ4D70NMRtxaMpDHD/9+wCW/CbfP6oDV8Z4Sk cOOtJCzVUimPYkf2KdDzu/poX1NHT85sFm3TCQZWlGK5bPzGABZQJqHoetpe5mgDGjlt 0JgPst92ufx/L8BzoXmayZ5vakMs4qCTncVvQZBQe3qVlRSP6Poy4/JGIkcZFfTtoPqr lrqnyYJScoUyJ2TcJz+fLQSCQBxJCbBY143wOraP2SirzzpzW7jBgUtTCw5Jh8+JCZm7 0apgQtyxnzqOyc6u476wEyXtnUT/ZdseEw7nqljogO1IdXdb9v9uFK77GlKawC/qk7ma 699g== X-Gm-Message-State: AOAM533SIJ3lg8eb2vv7T4rqbvmS/UxBO8amqnAMQ+UCBA8VFqxobY9H xRIa4p42w59olP7/JaWBNXY4ZgQe X-Google-Smtp-Source: ABdhPJxcpxLdKzn7NSxHfhH39qhli3s7zTHga2GgmkeesrvH1/k38Fk73Q+gdfgBcd/r4HHwg9CQ7g== X-Received: by 2002:a63:9259:0:b0:378:9366:2556 with SMTP id s25-20020a639259000000b0037893662556mr9542416pgn.402.1646144010485; Tue, 01 Mar 2022 06:13:30 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:1da5:b0:4df:c6b0:2ef8 with SMTP id z37-20020a056a001da500b004dfc6b02ef8ls8258011pfw.4.gmail; Tue, 01 Mar 2022 06:13:30 -0800 (PST) X-Received: by 2002:a63:8ac7:0:b0:362:da8d:88d6 with SMTP id y190-20020a638ac7000000b00362da8d88d6mr22304010pgd.95.1646144009786; Tue, 01 Mar 2022 06:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646144009; cv=none; d=google.com; s=arc-20160816; b=cAXmH512Q4jXZismZOQR6jwD6EWIq2tn2GBNDO4gY5tth+YHgdD3j5IMoHVkP5ebO2 NuUkFuGtAZ42nydIvkeeGMclWG4jZRC9gMhIDXB1ehkBKbdCE9YXNO7kjc4wOkjzqrRr /X6A9dEWkX2tiqnppiXli3iESSMdkKAgk1Zy0nnJVXS5+RUh+xupbuD9weOYT0PQHqr5 WAM3KyCFPjpw5qS69RpXkU0+kMj6qQNFfh1h+kwW+eTpLHlAncO5o+V9m54/UZ1TGE/2 buD3xE0+ACgrqtQ3Z3UepKwUdgUgQnz+4vINUayVxSw45EFqe9w7f5C0Kf4Nlze2zM7f HqRQ== 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=8VZ+1+x00//VHYdLM+85OInV2D6cw8S7xV1ddz5BzBo=; b=lTCB5mquPOta+ilJXL5OYshIm2OkrjqQpnQI/tbk6T42kJja3zKs064DftyY8lkKyi +Ks7CZH7tkkKz8399aRtKfwBJOGTkd9TdFW21NhrN9R7UfYPOBp/a+Vp69IXE/OrOiEq JL+mFi661ubDfWMRb/9iG1IJLYGe/3zyLTVBVZC/2csLSYAy51QXwa0XlG0oF3LViYEy dzUgkZ2zrf8C5F1cDtdjpdzM18LqJSYlSfm1hHd5PaJvTe2IIoFbNWcqLDPQzE5Gak3h Uzfjl63bIzqjmZtDDyl5cq/sA+KNWt8eUYzL++MkeseZfD61PyK+5dULozyMrbSmkJs8 NOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RwZ6EPrZ; 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 az6-20020a170902a58600b0014feccd4b76sor6779946plb.177.2022.03.01.06.13.29 for (Google Transport Security); Tue, 01 Mar 2022 06:13:29 -0800 (PST) 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:a17:903:32d0:b0:150:9b8b:12b2 with SMTP id i16-20020a17090332d000b001509b8b12b2mr21081165plr.40.1646144009458; Tue, 01 Mar 2022 06:13:29 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:28 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki , Linus Walleij Subject: [PATCH v2 8/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:47 +0530 Message-Id: <20220301141247.126911-8-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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RwZ6EPrZ; 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: Linus Walleij Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/mcde/mcde_dsi.c | 39 +++++---------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 5651734ce977..9371349b8b25 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1073,9 +1073,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct mcde *mcde = to_mcde(drm); struct mcde_dsi *d = dev_get_drvdata(dev); - struct device_node *child; - struct drm_panel *panel = NULL; - struct drm_bridge *bridge = NULL; + struct drm_bridge *bridge; if (!of_get_available_child_count(dev->of_node)) { dev_info(dev, "unused DSI interface\n"); @@ -1100,37 +1098,10 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, return PTR_ERR(d->lp_clk); } - /* Look for a panel as a child to this node */ - for_each_available_child_of_node(dev->of_node, child) { - panel = of_drm_find_panel(child); - if (IS_ERR(panel)) { - dev_err(dev, "failed to find panel try bridge (%ld)\n", - PTR_ERR(panel)); - panel = NULL; - - bridge = of_drm_find_bridge(child); - if (!bridge) { - dev_err(dev, "failed to find bridge\n"); - return -EINVAL; - } - } - } - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) { - dev_err(dev, "error adding panel bridge\n"); - return PTR_ERR(bridge); - } - dev_info(dev, "connected to panel\n"); - d->panel = panel; - } else if (bridge) { - /* TODO: AV8100 HDMI encoder goes here for example */ - dev_info(dev, "connected to non-panel bridge (unsupported)\n"); - return -ENODEV; - } else { - dev_err(dev, "no panel or bridge\n"); - return -ENODEV; + bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); + if (IS_ERR(bridge)) { + dev_err(dev, "error to get bridge\n"); + return PTR_ERR(bridge); } d->bridge_out = bridge;