From patchwork Tue Mar 8 08:27:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1864 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2DFA53F067 for ; Tue, 8 Mar 2022 09:27:47 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id p5-20020a17090a748500b001bee6752974sf1095798pjk.8 for ; Tue, 08 Mar 2022 00:27:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646728066; cv=pass; d=google.com; s=arc-20160816; b=qrHjCVkxbdEi7GR7Vm7CEtuIKQf+AzGuJCm7oc/SRUOV3C7lzE1Ubp8iPyB6SyCrzU 4vG8xDTum34p3EMpESJ0wX5Vy9qydNTh6WXCX0YCAdh1L8G6IghzEMjnxoOwvcgu0HDq 3IJhQ4fbB/2mMtKUcREIBQhphju/yqR8TuWMizAB4NxqfKNbBnh9sttN/zCWJOqIEh32 wL53EGnRJ40OzLHKWOy3mt0PijSWM4eXUFm/jEqKN0sndmfi5FVWdNnAj32Fixv0wy9x d9FJisC1wvgJ3cttFjDAMKvnS7zHbQMVKmiNzU6C6uqPZAFLa4V5oJK8GCYyd1cfHews zTwg== 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=edBeBQF1mFGnub8bs84L6xWx9EsmMWK5yoVIeIEcMTk=; b=a757R7myZsrmsyCGsK1CQ/XHNVKaZliAyZr3+7nETzOIg6WElhUaFB+6x1yRMJcJ2P +AL2rVVRmyUNxOQchl/RvMC7Lx0FhE89UnqabRfVIR/C+aidg8P+ngsNr9GZxVdW4/Vx lCTtv8MbTq1NksvWQhRo7E4LHrG4aQk6gxBliiMf2XhyJWJlsEOZyQpNpFPaaAQZ1CM0 8OnfO2vnRFU8vsoMcng7JXaf4WGRN9KjYY+F5EzUSuH8IPILDUdkAsJto9xLlPNcYq2I oK+3Yvo2X9WQyy0HV+f6aRuaQ1bHL6YYuFkTwc2oT2ZWJOMurNyioGH7+udiwxEiv8fQ 7i1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GC8kICxK; 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=edBeBQF1mFGnub8bs84L6xWx9EsmMWK5yoVIeIEcMTk=; b=cmwNDddc04H9Tmr1S2ENgYk32Vy+S3Exomfq3dPiGYmX3+ZmTq8S/YEnD4HCfh/EfM /VQdU2lwwBgOvSWuYNHSAemz2RN+BnmpJecd6p04ZDUc0FIWUcyCe/dCsmI5VHyE7BZr 7ZDE/y+rK9guRysAwAaF64G28QmAGQ1hWVc18= 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=edBeBQF1mFGnub8bs84L6xWx9EsmMWK5yoVIeIEcMTk=; b=3Mj0bINQA1OHYkqMpO+OLjl1XelAuZVPgWfPi/D5nHYb7bClsTCy8KHzJ5BUYxPXqU iu0VbDedhQJEOjb7zARVHdektam01/WTp91it3Hge6gRFSd730b9oNThSO9zGFKBe18E WpbVf5nkuL4lTiz8xbg85Y2WlClVxASsLI7RtLe6YjJCvzsLK9/WQmMPk8qA399fhhGI iFqcBbdA6EW6BMKv0V71qdwZ89xR7Buz9DL4bdVsoc9LOx+13pwJY+qJzrN47glVbGjf CqtfJEZOLoJDC8FkjBEicHf2ua3CsdZ+CXnhsXhj81ULhb8/B0XGH/21M/sdHuYp+PVg kIXA== X-Gm-Message-State: AOAM532pe1O06omdqYEdUTujx+zhSv0h/CdEM66ELY/WEFttK9ZWirW8 ywGmLd1a5qOniNR6xvN5xYt8UUcL X-Google-Smtp-Source: ABdhPJy34mULEiN7bh9gNZTfyUJl55Qg6x4b8G0mbEH/+bdwcwup89AZtn0XN1ldRTCSQnL3Ds3tpA== X-Received: by 2002:a17:90a:e7c1:b0:1bf:50c7:a4e9 with SMTP id kb1-20020a17090ae7c100b001bf50c7a4e9mr3425988pjb.239.1646728065896; Tue, 08 Mar 2022 00:27:45 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:c08:0:b0:380:5d90:d260 with SMTP id b8-20020a630c08000000b003805d90d260ls2158285pgl.3.gmail; Tue, 08 Mar 2022 00:27:45 -0800 (PST) X-Received: by 2002:a05:6a00:134c:b0:4bc:9423:96b2 with SMTP id k12-20020a056a00134c00b004bc942396b2mr17138586pfu.45.1646728065248; Tue, 08 Mar 2022 00:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646728065; cv=none; d=google.com; s=arc-20160816; b=Od5i/D5ssNdU11BFTi8pc7p24ezwlXK6mp7/uldvHRYy0dYb3E9x0jEdUR3Yv+VLjL ukKzIzJZti5bf9u/37rg2wnn1Y7UdBrOtRxflb/JYdYfeYM1GqOfuKFkyNkChGZa+RCB gCrQEBOJIUfYk8yzgtTep5gf1O4IU140p2xamRZ6/R66I9ZwIYx2lrhxX/8hIlP6vn+7 C0LachXhjrPJsMnL06YaI3/E0auB9WJXQzKkLM7N7aCXl87TzDW2f64JMiqdi/GGwu+2 m+hjPabC89Nf9zaeUfe9vytqTSUU8mxfS7s4pSv2b0y9rg80MSxm0xamCvm2m1xkZKqk 0QXQ== 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=wN3m2ndqA5HMdI/kw5XelwmrJbhaV3NLwlS6+vKGmUQ=; b=AVnDLNHmmiifXO4WOmK5HJTUCBxPrbETe8l8JB525nJn5WzuMRQfVIUmDKtdoH3i8F 9Ib1xYR4qysaDt/6eayMItUhUmSBy1HAvWwjFChy/PH/aDXSyHyiM1Bz3ZqUPRXVasfO zRS9ldQ6uiOxNmbDR74T8jMTcE7SSXelFiNiKRz4zsbSCdnZ2iJBC1u8WXwuIt6ITdGK C8qdLh9WkaDddJp2Qn11NWy65YPvpIe418jFZ1ryu+gZN+epmjHdGN4BDEsaZp4aMxHl xw+Y6ujON4xWr1/FmlI7eaBIHpKGZqrZQXH7gDh05pfyATTw6TVgK+lthzGZV3cLIoXP 7IPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GC8kICxK; 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 b18-20020a170902d89200b0014fe9289a03sor1534639plz.179.2022.03.08.00.27.45 for (Google Transport Security); Tue, 08 Mar 2022 00:27:45 -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:248f:b0:14f:acf5:a5c2 with SMTP id p15-20020a170903248f00b0014facf5a5c2mr16444969plw.167.1646728064950; Tue, 08 Mar 2022 00:27:44 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:c770:6f0b:21a:8de4]) by smtp.gmail.com with ESMTPSA id r1-20020a17090a560100b001bf72b5af97sm2000671pjf.13.2022.03.08.00.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:27:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 4/8] drm: bridge: dw-mipi-dsi: Switch to devm_drm_of_get_bridge Date: Tue, 8 Mar 2022 13:57:22 +0530 Message-Id: <20220308082726.77482-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308082726.77482-1-jagan@amarulasolutions.com> References: <20220308082726.77482-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=GC8kICxK; 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. Signed-off-by: Jagan Teki --- Changes for v3: - none Changes for v2: - split the patch drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 1cc912b6e1f8..b2efecf7d160 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -315,7 +315,6 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, struct dw_mipi_dsi *dsi = host_to_dsi(host); const struct dw_mipi_dsi_plat_data *pdata = dsi->plat_data; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; if (device->lanes > dsi->plat_data->max_data_lanes) { @@ -329,17 +328,9 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->format = device->format; dsi->mode_flags = device->mode_flags; - ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, - &panel, &bridge); - if (ret) - return ret; - - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } + bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node, 1, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); dsi->panel_bridge = bridge;