From patchwork Tue Mar 1 14:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1849 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B2943F0D5 for ; Tue, 1 Mar 2022 15:13:17 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id b5-20020a170902e94500b0014f6d0a417bsf6206705pll.6 for ; Tue, 01 Mar 2022 06:13:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143996; cv=pass; d=google.com; s=arc-20160816; b=D3IOcHfrxnCp8oEC4e6JXHhzNHCHqRi3nuacspdTkcNvI3/lLXmQvl2ra2COmUcI+s 3CiUEksE5FaYLSNsjYQ3fbV8DSBR9DeC5rhoRBiNAdz0+ngOz8pkrpUIBleRsIzrZikY 6YyIZPd9Lh/mR0fgcDGM8jzESHlQ/Laa8mhGbJKlEZRp+JC+RfBYi0YWe9eK+DNEHjUq c+Q0BIU+idPGV5aA89BBCggaO0U+yhYtYklXm9jypTZ/7luDSAetbMkeTZ0hNqU/EC2X nfmwE3CrczbDU2jn6ZiTPyqwWr6UmfRAY3Fzzkvl73lkKF4nMDUsz8mX51W/uDQ9EAsX hhXw== 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=T8dTW/VGVtiwse6Mochb6WMtLSEsM89ZNExsvDThy7I=; b=NT0DxARQoEwe7ozs+z0AK3xyvvVruAIwqlEV5gE6T6uezMvT1tXiKJdZUp/3tYx+N9 du74bPlnWJ8keQ7n1cFEFdnGIoIPp58yAA0zy0Pxq5z8rnNpf5717OQA+VrOnPWnjytC Jazqp8HIgkBk7hRdpi7/y15wsjjCLcw9jJCk1/FXuSJnve1eMbnzoViGWJ4sv7iP+FfL iT4cjEjmfVpZCHidCDTVRnLYotKg2PQqz6AmHZpcjXPyvwDb0ZeXdzHjv0tl9l7oyaAD yk3LARaD9xA1lKJ9zopYdSQUyYJQc6bkwKLNZFedZ2srS5ApeaK/NYDp9h3DKqe/Wcxg gZKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="pE/TUj95"; 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=T8dTW/VGVtiwse6Mochb6WMtLSEsM89ZNExsvDThy7I=; b=Tc05Xz/IV7SaeXbQlhkY9Io2m22zLhb1NT5+akUzdpgn93dLsb5MlWKtGKimgN8EtT lrmrKk4BIbh/eiMsqhyYvLz1NzQ03lc/pZlA4e4/MSeM/bXlvQS7vPaUxOBfoi6jmAAG CaIVwAkd2wLsm7ODhRfNJ+EPmy2+kV6Dfu4qU= 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=T8dTW/VGVtiwse6Mochb6WMtLSEsM89ZNExsvDThy7I=; b=2f79BAMbc8WCHyq/31o2fF/BU98FffVe1XzEw6Y63X6Yczqkb/Nx6ysKPAhdC17q/e 5vuq7aITruvGrDxDo7VBhtl8gIq6d5IWpgN6Egfwlg0fodBf2NzLdtIBtETtmeW4sIX8 1MFe3fslUwuzTFrv9wX92zcuF68OuVO9TvQKWEYihL2bseh8RCD2eLr3Zn4+EIfWfXZ7 bNDx/1erP3EAT/i3Dyk64LOaKbWjw1mpcBOM7F5KZoT4NUX/y10b9nrLQJ0RASDUPNJ5 eFMJv+46A6BdNg6QsEOor3cE5Jf8BVyTkA3gwk6cNk3q75XfiftkcDNf1FSam/nLJB4s q84w== X-Gm-Message-State: AOAM5300ytpLDNBBFzfiCT7EkSNwC2cSNfyXUhCeE/9NzYdlFhxTWu92 UcgSLcQtRZBFPSPOAKigW0Qu6bvm X-Google-Smtp-Source: ABdhPJwm4Ru21N0qo+TN0qlFFsnp/JMkMDRoWqw6GjdcwlRuJAh3Q2WtKjRsCumtfxjA2d/QdAIWKQ== X-Received: by 2002:a17:90a:319:b0:1be:d55e:af43 with SMTP id 25-20020a17090a031900b001bed55eaf43mr4587002pje.231.1646143996070; Tue, 01 Mar 2022 06:13:16 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:6782:b0:1b9:7c8a:8c03 with SMTP id o2-20020a17090a678200b001b97c8a8c03ls1966946pjj.0.gmail; Tue, 01 Mar 2022 06:13:15 -0800 (PST) X-Received: by 2002:a17:902:ed93:b0:14f:c84d:2448 with SMTP id e19-20020a170902ed9300b0014fc84d2448mr26164990plj.64.1646143995059; Tue, 01 Mar 2022 06:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143995; cv=none; d=google.com; s=arc-20160816; b=ojC/R/zWJ0umq6rQlJ5wOXeVTiy8pZ0x3AFTr98G8PduQ5Axj/lmnEHeMPrI9PB1VQ eJeW2v/eIEUOg29rbdAo/8j9chordsY4XcThuzdfcCHY7ef3hhaAYd7/b1idDGIl3L2g 7vBHu3OpyFBGXHmkkqDUDqBoUuqWSTVq738OH5z1xfBSdLr1dwzVQ9hiHgKnFdn4wMXh T37wqXY/RpUBFf5fjh9grGgBm2g9gnRCEvh4gV9zZhw5Co8sd6TM3Q3gQyiHv0rdmvFB hGTb1moabTVSIrxaUxm1tNSskpPLD/ZXAzeW22OFkplAISQpgOhamQve8HwnThRktzP3 Y0DA== 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=+ADBJOJJawEycdkHMuo7YSP3/OwAMSkCIo3gpljHm8c=; b=TahVycdFPwOEKFQkxxkc3RcBkUNaOwVMJx2jPL0CIjIiGHDKpdZ3AZlkuq/pQc4Qoa mWMYVv0jsyxRvsdFCpyvBU1+Oe+PJyf2Fli1HGtSfPivgansFxUVuX/FU1SQIP1oF8aQ cU2oQ94xgt5ML2dD2v5NtvI/Ce6/TsQV8eby/Uapou6m7FJuRQsFvcYwcHQkpC7w4YE7 8zS8wXZLyqSpvkeq9H2yLXqzaT24+Na2YFmiMieIOfRfoy780nKJfRbQPymny1u2ksaN tno9//7VD4V7V+r361uhKpb5dNp6U87VEw2pEzbjTB1tjyJFwqhDYlkRLjJFD3eXRubd 91sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="pE/TUj95"; 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 r11-20020a170902c60b00b00150013dc725sor6579678plr.171.2022.03.01.06.13.15 for (Google Transport Security); Tue, 01 Mar 2022 06:13:15 -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:902:8498:b0:14d:cca6:741 with SMTP id c24-20020a170902849800b0014dcca60741mr25507576plo.16.1646143994756; Tue, 01 Mar 2022 06:13:14 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:14 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 4/8] drm: bridge: dw-mipi-dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:43 +0530 Message-Id: <20220301141247.126911-4-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="pE/TUj95"; 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 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;