From patchwork Tue Mar 1 14:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1846 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D13BC3F0D5 for ; Tue, 1 Mar 2022 15:13:06 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id z10-20020a170902708a00b0014fc3888923sf6229463plk.22 for ; Tue, 01 Mar 2022 06:13:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143985; cv=pass; d=google.com; s=arc-20160816; b=SXh8aYJvCLvk28evnHweLZCKyBJ5pa0rtcYf3jEGuCiyNIAQlHAzYEICMuRHd32TfJ 0723q3Ly9mxNMyp+FKQHkVQ6z0bA67LMfjiPJ6kkOMb/VAnr0kkXb5RZ3Lcg3Y5x66bi 1Mu6ZuL1aZHFKZeN8FYbXZ5qRVsiKi6j+2JYkrJpW+TwYeKdfgiRLwyudp52DaWKhhU6 PuS2fORaLls1Ca0R9PpjezaUMyFZj/9KZLAFPCbOoEyi4EC/tNkDOgDxXZmqJ19dkNzX 6dkZeKXLCZepnglyg+1dGr0usvDKgfyMGjEkEY32GSASQWGLMc9oZYkocEOt9Ks8Jbio P1SA== 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:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=lsaf5f6fjCRYBgpomogbdaTck5zcWb6JrIiRqyArQrOrN+xFu68LgjiGK1yFQXkogl 1D4orE7nc04C8HlG5Hq+jLNN9maTeAJdkPfHw6TmmrIeoOD/WA9I7nv/c+c0nDGvmpA1 CVkUhaAXIMmm/AIW2wkUmijBN5WnVInZdbgEliDXqGWYZw4QqexuJ2d4GRZ0hkZwEQmY fhiNmcVwulY6PpaaPca4KXSsAyomQlj2tqronBybJv0DJ4jZ7+eG9Fi1VO7EhemnCXQw HyiHwnE+MGTlEKVeEW+nmvayPe20ti7GNQbUaRYL8QfcOfOklLyOE+d1FUpvqrj1lopb PTgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JDuW9iUm; 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:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=GxivPHSO8L7/5S93QI7L2tGBbjTZDXj5f2PjclQEbKsV5oKHwWNQWlRox/ExnkzGVg Kx5FpCPW9Gk8IODsPqYViWeeWzlLs3U9WMSksiUieliKuSwWuhDg2VqwScgYF4ngNNsS rAe890PthSSN4gz6l0d0OfZKZ8/Be3vVFx0mc= 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:mime-version :content-transfer-encoding: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=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=ihnzFjRcHPGnRUXdHd8wVp5arqujQUr2b/jVFx3fWijan6ZcLCDE16iL5DGEnqkq20 TlduxoyWaeT68Ovv60s1LsMew3+g0Hx9V/bKbqvDbnjAIaMqTHXV1xSiR3hqyiZJfyL0 /kTgttgPAduYCz8Cdbrcy74GkomJkXM+0w6C0jAMFBcoP2+jbHNLaE4Q3UOje4N2/l21 JnkW/EKDARLQfE9m4bpifc7Aixy5hosR67r0r2/h/KKp9aQ3LlOd0JP0qxvwOoaTk89c r9IQHP/yZULwbzWLdYPy/2kb4mMqQBocxgdE3YBhb3LUorOu0bRP88UNpW+pjQ7zLX90 bn9w== X-Gm-Message-State: AOAM532d/LNlwnGOlRKSWol2X2aLbu0eFL08BEvVxU5e6/dahpvhKv8b byG1+qIxih0vK0IqYmHqrBskuaKM X-Google-Smtp-Source: ABdhPJz4pwX+spNmNi4xkl9kiplYMA8Sob9lOkuwgVfj+XlY4j8CdCgU2QWh2sjPQKU8FrztnWK5Ig== X-Received: by 2002:a63:9311:0:b0:372:710e:2263 with SMTP id b17-20020a639311000000b00372710e2263mr21417411pge.223.1646143985508; Tue, 01 Mar 2022 06:13:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:cec1:b0:14f:f089:12b5 with SMTP id d1-20020a170902cec100b0014ff08912b5ls12453912plg.8.gmail; Tue, 01 Mar 2022 06:13:05 -0800 (PST) X-Received: by 2002:a17:90b:197:b0:1bc:5037:7c52 with SMTP id t23-20020a17090b019700b001bc50377c52mr22264545pjs.174.1646143984786; Tue, 01 Mar 2022 06:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143984; cv=none; d=google.com; s=arc-20160816; b=sJqkxsbFD4b834nDmfi7545SfaDDapPASUWtjxz7SLG4+MlxjeaeGqqjoCgekDbJcQ MxRdd2OkHX2LQcfhLoRqYrZ8kbvF1iBjf9Nm30jGItjaDdFGVZWfIc1rTymleOW4NnDD +LsiFMS+DaM36R9CF76yPXjiM9PsMZixk9NFT2UT9zRUgY4dOCzGo4ZBn50wgImeJoAy vu7k/hZmkEJyX+RsXUPvgi4C9flAgP2PGzP8MU1WDDtldqQPMIYn0gy/qeKSN68t4/t+ Jcky7B3L9pZtjhBiACgN1StoGy2Bivq0kV2py6nv7VAM8LJLaSklA7hFqRP4NfcwUbVD YIdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=2B4o51whjRTaRj0FzLtK0MK8NoU9GtLYROjbqylZQvk=; b=xUgZZggd4ilsVctth45wD+o8F/Oejw8bqXY6mCkR7C168wTaK6Px/2SEUzeJC9hmrG poXzLCJ+R/hQ10J1CunRiw/UQ4zzOil0AAt8rL9dMF1vxUgyWtENbEdN0xyikEUvm5/W KTVKw7g3ogJXA2AHWdABg/PmEBPiOrLwayKKbBJkW01xsjQ9oS+UyQhzDD+k7X0xO9f/ KLbO2jxONYNtWiDAz84p8pUZlsvVWsXX0FN6pE6xciEwUbgUINyI69W24G5Xx3xDYBBZ e0BU/9u5Kn0iXsYMwcel50+2bylAKv6fzPL3XvLwkkP3bEzrs8PP/+0TrEBczCPoJTp7 rO2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JDuW9iUm; 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 u5-20020a17090a3fc500b001b8cc417afdsor6368612pjm.0.2022.03.01.06.13.04 for (Google Transport Security); Tue, 01 Mar 2022 06:13:04 -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:90b:10a:b0:1bd:260a:97f9 with SMTP id p10-20020a17090b010a00b001bd260a97f9mr14994313pjz.71.1646143984420; Tue, 01 Mar 2022 06:13:04 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:03 -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 1/8] Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" Date: Tue, 1 Mar 2022 19:42:40 +0530 Message-Id: <20220301141247.126911-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JDuW9iUm; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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: , This reverts commit c206c7faeb3263a7cc7b4de443a3877cd7a5e74b. In order to avoid any probe ordering issues, the I2C based downstream bridge drivers now register and attach the DSI devices at the probe instead of doing it on drm_bridge_function.attach(). Examples of those commits are: commit <6ef7ee48765f> ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe") commit ("drm/bridge: lt8912b: Register and attach our DSI device at probe") commit <864c49a31d6b> ("drm/bridge: adv7511: Register and attach our DSI device at probe") dw-mipi-dsi has panel or bridge finding code based on previous downstream bridges, so revert the same and make the panel or bridge funding in host attach as before. Signed-off-by: Jagan Teki --- Changes for v2: - none drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 58 +++++-------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 11d20b8638cd..1cc912b6e1f8 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -246,7 +246,6 @@ struct dw_mipi_dsi { struct clk *pclk; - bool device_found; unsigned int lane_mbps; /* per lane */ u32 channel; u32 lanes; @@ -310,37 +309,13 @@ static inline u32 dsi_read(struct dw_mipi_dsi *dsi, u32 reg) return readl(dsi->base + reg); } -static int dw_mipi_dsi_panel_or_bridge(struct dw_mipi_dsi *dsi, - struct device_node *node) -{ - struct drm_bridge *bridge; - struct drm_panel *panel; - int ret; - - ret = drm_of_find_panel_or_bridge(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); - } - - dsi->panel_bridge = bridge; - - if (!dsi->panel_bridge) - return -EPROBE_DEFER; - - return 0; -} - static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { 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) { @@ -354,14 +329,22 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->format = device->format; dsi->mode_flags = device->mode_flags; - if (!dsi->device_found) { - ret = dw_mipi_dsi_panel_or_bridge(dsi, host->dev->of_node); - if (ret) - return ret; + ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, + &panel, &bridge); + if (ret) + return ret; - dsi->device_found = true; + if (panel) { + bridge = drm_panel_bridge_add_typed(panel, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); } + dsi->panel_bridge = bridge; + + drm_bridge_add(&dsi->bridge); + if (pdata->host_ops && pdata->host_ops->attach) { ret = pdata->host_ops->attach(pdata->priv_data, device); if (ret < 0) @@ -1021,16 +1004,6 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, /* Set the encoder type as caller does not know it */ bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI; - if (!dsi->device_found) { - int ret; - - ret = dw_mipi_dsi_panel_or_bridge(dsi, dsi->dev->of_node); - if (ret) - return ret; - - dsi->device_found = true; - } - /* Attach the panel-bridge to the dsi bridge */ return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, bridge, flags); @@ -1217,7 +1190,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev, #ifdef CONFIG_OF dsi->bridge.of_node = pdev->dev.of_node; #endif - drm_bridge_add(&dsi->bridge); return dsi; } From patchwork Tue Mar 1 14:12:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1847 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 E047C3F0D5 for ; Tue, 1 Mar 2022 15:13:09 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id e7-20020a17090a4a0700b001bc5a8c533esf1712110pjh.4 for ; Tue, 01 Mar 2022 06:13:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143988; cv=pass; d=google.com; s=arc-20160816; b=Y5v2HL02jsrgQ6ru2sTfO4PLgf+pOEdz2Qq73FYVKil4Pegt9QoKgl1mXSCuFYslZg 3nbNi0ZdmkozV9LEPemXWY3IYx4TPFzwS9Gg+i51e9OCuXrSU7riF5+zctkAQEKDk3lY vOAUPZ6v5yJJwUJ5WDydxs2ZqnGNEYzUYceT0z77nNBHrbkEZNa9cQaireu0170MousF MC9luCWMgz/uDZOZlQrScYm5kSFJmzN8YwlCXUGLsar4PrrFQSNUmrSt4nN+oPY/WwFt einy38g5HJDvJH9rvlaWr9QgnXS59Bbcghdj1JHoPkjLWG7GNGpjJJLPNiS6GMEGw22X /dEQ== 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:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x7fR8OIAMxkw1M51vRb1l/lTW6LaxlciuJahoV4cjiY=; b=uICDDEb6+wXvccXKnwJLvZdblWHDtzq0oyZAJ9uNgvQKF0oJyvJxwwoKeL4OIr21mR XWkvoZUNuVqQlcW8ukXsYXG4KIjSg19JVq+3DN+IWB4JBPvGACuAI4xF72IGt4h2ZFF6 PS60GBpylpdqhUOmsXrtE2gihTQkOdRT5DGyuTQEhBMuv4Umh1nUtFcXnf7tANdj6LQW lRGoEfuix5EiTxlsfW19jnv7ab+OXMvFQaqik5/eEYpp4yIkmmaifuQ0YfI/txUDAeiQ D4OLYt/klnGj0005g+xdW9rwVdF9f0uGTHJF1/quLzybbGxZeERrnzwc8TrXPM+2gXB0 TZ3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NMigUEfN; 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:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=x7fR8OIAMxkw1M51vRb1l/lTW6LaxlciuJahoV4cjiY=; b=PPJ6BqwSfmpe7B28tZUR6xi7p+J0BCZKvs2F3Rf4A3H+KP8h0Grw6aipsNQZwPpHCX VbRkeAsq836EmWqoh3vwASSMcPhjPoMz0309xKToWJJRLK6LN0FwkU7g8kNq0R0GefUh BJesY20fwBYCEZoMKpWQHiI/9ny+uomMAcDuM= 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: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=x7fR8OIAMxkw1M51vRb1l/lTW6LaxlciuJahoV4cjiY=; b=rQgVCo5tf5xqIwpXjbFV3lSdtMz7C/3VT5S3UCXbGtGQoWTFt6EpGDXYg4L5i0PsMj CoaUw8CDCTvI5kVdwMBM+2kfVvlQDoNpPcQVhoR1wYpmwEDgryPwln7Q/clxek0hptl9 889GD5UsjG04Wdhk1/mxDvgTzmhARDloHaJrLrCLsSUsteyA8eF8C+UczQDFpmTO/kz7 KOdwB4ta2qmcbYptpf4NyhbrMQbYU7zd7JN4lYa0qBSpmwAjl8Fy9h3hy+el9lnlCOUn 2x485VFjIBq3OtVhk+dvSdoswW3bDoNKgqd96TpB3X4+E7tN/JjRqpUPs6m3bJV2VNSY l8wQ== X-Gm-Message-State: AOAM533JPIeYYmZjJ1F0guXORm29R0yHnxi6v+YuegAgYm7vdce6CD/q yvN0vCAkw5/E0L4OoF7QoTvQIn+z X-Google-Smtp-Source: ABdhPJychUxkLIRfpsaLmwGP2YtQMFt4iKby038kwNtA5X76Nw408kPQpUX9i/bwtnPbHwWoPmvmHQ== X-Received: by 2002:a65:554e:0:b0:34d:f721:7fef with SMTP id t14-20020a65554e000000b0034df7217fefmr12677472pgr.476.1646143988730; Tue, 01 Mar 2022 06:13:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:f20c:0:b0:4e1:2ff1:c729 with SMTP id m12-20020a62f20c000000b004e12ff1c729ls7059474pfh.8.gmail; Tue, 01 Mar 2022 06:13:08 -0800 (PST) X-Received: by 2002:a63:eb0c:0:b0:373:334d:c32f with SMTP id t12-20020a63eb0c000000b00373334dc32fmr21870066pgh.358.1646143988028; Tue, 01 Mar 2022 06:13:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143988; cv=none; d=google.com; s=arc-20160816; b=hXSzxtZDbE6rTtuowGRAEzRhBuOL6eDtRBMOTahdW33Xbshnl6rmovGRxmgoPt8iRk v3jdQSxSLgsRs5iD734uh4eZkh0LBvhzh9ez0cSOaOztA4ZUbHHf+yXUt+PjqRLmhg6k atv/gThVbfScc37uQn0JsqnoKHh1xKrXYs3JmQEe4dprncwBKsTNXK9o+19dml71scqA zGbPMch94ySooM5Kzt5r0OrKcOoOvuyHSdumyUE5UbPX1pQHIzMCZfTinNuwcA82YMVB w5hLkFkVvz/vk1m3GuFC+8uy7Nuz3gYUr0RZnmkTyLTzzIKQHZ1DaqPJ9P44J+D+NJYu DREw== 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=Jr8OFiwMRBvf5MutYyJeoPCBK98kvnIvJiMdmm2+r/o=; b=UQ4bt2Lx9FVylaNVWWTyz8W/IIyq1t8eVRddqhfLxw0Xw6F5gcj75n9aTVi/SJQVTG B7ZUCj0HkmS105kp+LN5XaCLrDVj9jhE/txKrmjm6HuO+VQiIUdvKEnMmFEWcC1Xee1t yuDkPuBflrX7v2Afk16FMfDW45L9BfG1gNZI7vQWz5i6qdXbOmiioK8FTpZnxLOwKkBh 1wwZl/bIhF4m5uMXHGXrRPGg/Jcvne2Hhj6DW3JqvPE4C+P3h4Z6OnKiz51DK0qcLm2l buMyoT7XPgkCb8JI1+mIdGIZll8nIPegYHJyhG7Xkomsh2QvpKFjYykf6AIxY2ZRz73F KWVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NMigUEfN; 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 s5-20020a17090302c500b0014fea851be9sor6627310plk.86.2022.03.01.06.13.08 for (Google Transport Security); Tue, 01 Mar 2022 06:13:08 -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:ba88:b0:14f:9ef3:f80f with SMTP id k8-20020a170902ba8800b0014f9ef3f80fmr25379972pls.170.1646143987730; Tue, 01 Mar 2022 06:13:07 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:07 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki , =?utf-8?q?Guido_G=C3=BCnther?= Subject: [PATCH v2 2/8] drm: bridge: nwl-dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:41 +0530 Message-Id: <20220301141247.126911-2-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 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NMigUEfN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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: Guido Günther Signed-off-by: Jagan Teki Reviewed-by: Guido Günther --- Changes for v2: - split the patch drivers/gpu/drm/bridge/nwl-dsi.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c index 30aacd939dc3..c9e108a7eca2 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -916,22 +916,10 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge, { struct nwl_dsi *dsi = bridge_to_dsi(bridge); struct drm_bridge *panel_bridge; - struct drm_panel *panel; - int ret; - - ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel, - &panel_bridge); - if (ret) - return ret; - - if (panel) { - panel_bridge = drm_panel_bridge_add(panel); - if (IS_ERR(panel_bridge)) - return PTR_ERR(panel_bridge); - } - if (!panel_bridge) - return -EPROBE_DEFER; + panel_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node, 1, 0); + if (IS_ERR(panel_bridge)) + return PTR_ERR(panel_bridge); return drm_bridge_attach(bridge->encoder, panel_bridge, bridge, flags); } 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: 1848 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AFF903F0D5 for ; Tue, 1 Mar 2022 15:13:13 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id v127-20020a622f85000000b004f3dfd386e8sf6880008pfv.16 for ; Tue, 01 Mar 2022 06:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143992; cv=pass; d=google.com; s=arc-20160816; b=M4eZ6y8BsT06nB6AbjQSbN/oEeoGHaep2zK4R4JidkfGGEEaceszLpojN6VY5t46L8 CjlW4cZEFoUvRgzeD/10y4LGTrf7EUNWyMpblM4Ctg1Nxv87RQglEuWe6+JPBAmXc2Vq XKd62t55QYaRDD1oLZ/8X9MBezG898AspzPukUhWJEEB3iab/zfkrtPTT5IBYyBD0BPz 2mtv8LX4uW+Y2D5xDnsJ8Hl5lNuZt2tR/lzZ+/eu2pXznZtFZnWxnVO7/Z2Hz+oySTq+ jhZLGbrJDM/GAEFrwPnEMi428eNmukv5JND3l0aP3FenzTWgSOtT/b7GKnpsqKEcjqtt oFmg== 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=tDCZf1ozvew0khHIg+yukoVpVjf71KpwToacoJRhHt8=; b=rdGWYreCqQjrjt1JZMEYk0+n68DK9vBcGGOtQ9zpBrTB6uIHDuiiQcsQxHH9p6/29B MbUHIyZ+chltYNvviR6RvQ8ddNcaPlTJmwmg//zl0i5p5FRSJsknJmlaVL+XTy6ef9hs rsvm7TT00wdg97VAEVSEigXThxFnWweS7QmZm+6diiu7IHBZ0Ev4+U6ZpC+DJNz8Are/ ptAM8Ie7wVUPO5Nnh8ncXOjyet3tCpuGdsDHk8mISgEHE8FIu6L4BhkgvaTliD1DWRXn oOZFKuF6mSRSUfVAxkUr0xOtf77xl8a8XX0Dysnm1OempYL2g5QGBy/Oaf0wRKBHcLkV xirQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oayZNfVC; 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=tDCZf1ozvew0khHIg+yukoVpVjf71KpwToacoJRhHt8=; b=J6nZlyg1kh8GVhqJ34oReEzJnL5BmrFoO3qWW60iSGHjg+g4GXybqPfJ+jtmd217jl eVXffBK1NVosdb141GvU7EtlWL3TX/murQXeCweWsXIo4AN0t/6LQCgg4cqspTUxMY+D 4hCacacCgE8jAQkN+sJ3R/8Jvagf6KJstfCnc= 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=tDCZf1ozvew0khHIg+yukoVpVjf71KpwToacoJRhHt8=; b=mqBIJ+OM8f6AzIetW20GWRlaSPc6DV2TS/3nxIkzBZsvq8GjPeZ8GX9CeILv9TCKJZ 2cHh+Bz6Ry8HN/v8sGOR+sQXbPVcAoVgl0wdEu9xE6oZ/1bFGYW5wBRSHEFw8U41W4o2 2lEsWs+W5a7p4WyXZ9b0xO/HrYv/EpYeVNTnnLyD1e+zSvp9+5gpBdso+3ipEJjpJBB+ SVKLIErvL+at5p1maQ2rKMsQknvh8zKIF7YpK8ZdLaNlLwyiMtm37tbKO6OzpJuHGg/w Dt70/09lk/mw9gvK8qfkdX+vJZ4ZS3acxq6ZG/w7wJDajZZB8OjbrxDFmXqE9b/yPC6u Bm+g== X-Gm-Message-State: AOAM5330nDZ7SQJ9X/RqIGCRVvd5B0ojS8q6K2mocDCvnpBdb8+iwP9I AOMYx1BBdc3cKgzML/w97VAUn3sq X-Google-Smtp-Source: ABdhPJyMHMhJc4LjaaCmStd434oLzUjm4DnQXXt+FFdhPfzcqHYDEExrcSma04PRi5ttpkpjTPVGtg== X-Received: by 2002:a17:90b:1a81:b0:1bc:ec26:40a6 with SMTP id ng1-20020a17090b1a8100b001bcec2640a6mr22179802pjb.0.1646143992497; Tue, 01 Mar 2022 06:13:12 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:cec1:b0:14f:f089:12b5 with SMTP id d1-20020a170902cec100b0014ff08912b5ls12454131plg.8.gmail; Tue, 01 Mar 2022 06:13:12 -0800 (PST) X-Received: by 2002:a17:90a:528b:b0:1bc:c5f9:82a with SMTP id w11-20020a17090a528b00b001bcc5f9082amr22038760pjh.210.1646143991844; Tue, 01 Mar 2022 06:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143991; cv=none; d=google.com; s=arc-20160816; b=Dfk7HBW/ebfIVG1o+AyLbq99J+9LYUyxS2s7chcqAaO7fgsGuWnpxt581QYcONMfVg 4T+5TVYODXsWpUWNFuYhTGB3fV6B/nusoj/HTb/nLsydoywvMgNxO7hrnGI8zmcC9J09 GijRa80nMK17qV+yvoVD/emxjuHqp84uOyt6dA2bsdOEfx3diDXJQXBzuyRgmL2nD6LA Ox0Fj798CaBY0cKvVNs+dIAFvHOv66yZKmYdZmX+55QSReMuEgBrSGxuNFn0wmR7YnKk 595mP0nxyjwfLWIeCC3EGIG9FVL8JCxa+KY7O8vIIecTkBMXdcMHAoOOwRqPO8AziYKf KWCg== 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=RfOD5os58Zi+V6L7F7QFRD9/WvrhIP6GUWjSjvrBko0=; b=YbAL9R4zhnI0LofWEDsiWADjawKN9b1R9GNOq4lrZGFYFtGA8KCTIoifoBoa/B+ynw KIUkGNqe8shGqXXT3JSgpHvylMaThL0THvmVYifTMQjdFcLX6hqywW8fCFy0UiHtfqd0 MgTUAU49hseozCT0mP/iJDg+5SGHQoLn/pyQJ3Hdo8LTDMjHnBA2oJH2FsgVkbyo3kk9 SLY0psh5KXNztt4EeNaILX/tV43SkFI61Hda/Y5xWlbyyUKdxZZjDec0kkBLigfn0C1g f3AKTazEPCwoE+uvI9M+a7BVJC6vGbQpOjlKYsdHeWwLuPRj/LD/hFXbAXWVf/NVPv+q jaFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oayZNfVC; 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 f10-20020a170902860a00b0014fe92899e3sor6796741plo.147.2022.03.01.06.13.11 for (Google Transport Security); Tue, 01 Mar 2022 06:13:11 -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: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 Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki , Chun-Kuang Hu , Philipp Zabel 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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oayZNfVC; 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 --- 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); 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; From patchwork Tue Mar 1 14:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1850 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0BC6B3F0D5 for ; Tue, 1 Mar 2022 15:13:20 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id d192-20020a6336c9000000b00372eb4c4bf4sf8640647pga.8 for ; Tue, 01 Mar 2022 06:13:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143999; cv=pass; d=google.com; s=arc-20160816; b=JshlZmj3cGlcP+Mlv69i3hIo+IB0SFOvi7vjubzXzEL1SYnyhBsHPXT/qQXOpXIrdS +3tYLeecrnUttC1jD1395Lw/l7KpajuEAP/46QHfQk9XuzjOTs2+Oh2AnE/SyZetXSCB XSzLb3BdN3oor5Mz2hHv/0DbUuysIkogoRqakzhIGutXSPNCEdEFVDc1XCp5bY4Db4IX 6dT6dgOFCYqBimysvo2N3u6hhG4fccjTq2gsrfPPuYIaKNQxJCnpUG9yugL+6ebtLE5M gMm41pgeYdZMa7DYeOz0b5ZSHSgVKpaTbgb3C80osrFyTYN6kI7zb/tt1jf2hy7i3Z92 YcWA== 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=n5fep2zyoBUiwWeAb2XGyKQfCSNmCkjoWsa+7Du3uz0=; b=bd1o9Zt+rNwqf2pVN8wGTr8Lo/nHN+WYSodpKO/y3xkoy+4aUYAtg1kx/zbUvT1/Ff nFOaSEqvBWd7Vg7J6iK9GNi14tI6S/YWO5WcVpI2VMspC/aKlp9JK6m7T3ll4MSy9XX3 nwLVLWo21ACy+vrE5BUHsbRks/RHa5vMIVY8XA946ZCJplNOvjyy0f//hQDtVjrHF/QT lVDCl/kkisjfBN9l2SVFlIQGuH7VMQs7TTD+58U83DVTI1ssGONwlV9G1FPr/7KOBZ+O dgaxHsMXkCud4u9cuyTOk7Fb96t6HjUoJek3OsHAQVvouROdNc0DQ2m1Og6uzpFu06e6 bmzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kNzeZ7i0; 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=n5fep2zyoBUiwWeAb2XGyKQfCSNmCkjoWsa+7Du3uz0=; b=gGR+gKivA3tem21WPhKiKK5UYJReocvWuCJYUmP+dJKjW0hekseE3jyP51N/dHSsSt 2oyoZBjaNOq2OOSSotyPaazdJDyQiVL2YelglSp6JBUeTzQlAA4sModzb63ofb5sYe9a usYB70SycYU+ZBAWiyMli2QL//sgBD+5A0V+0= 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=n5fep2zyoBUiwWeAb2XGyKQfCSNmCkjoWsa+7Du3uz0=; b=E+uMUuwGojC4H2pz1LYSN/eaX6yg+AiHamIhsw7pPyRIb8Q9CjH2X/0A9FTX/MWwcU qVpN/86UKfl2izu3uAKg6Hg9lpD/1a/ix5A6yEGpgydxnoSsERC0pabCwPHQcWzwg6c8 8pqC1/JQZnSiUHuf8S+jK9PaVsx/MFK7w8NPZY3cOSfqNwX4bfSaWrZyr7KGxeyh1KXT kUZ13RPO9g7AiF+viXUaixV861lrWXOwImh0tlvEol/+Jjebnh9QJjGIaH/F+YsMitHK /+ErC1zuSUj2zut7zTv8VJHzB4ZRtZm36dbf2mi+cOSmP9l3Z95K8VZcYBk0jBylo6wh z3fQ== X-Gm-Message-State: AOAM532CFtJs3o5b5kI3/YKIw01vKhDZ6lDeGE2QN2DrOgvJQnzoUAyH YEDzoWV/mAd7hAnkxpfWnX/bry34 X-Google-Smtp-Source: ABdhPJzYit5Fgh16txMrqlwz5AUnGFzHdRJr6zQ02L7D6lRQI3xDvpXd5jcxL8uBksdbhs9G/JhcVw== X-Received: by 2002:a17:90b:3587:b0:1bc:87f6:73ae with SMTP id mm7-20020a17090b358700b001bc87f673aemr21913470pjb.14.1646143998851; Tue, 01 Mar 2022 06:13:18 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d48f:b0:150:b5b:5387 with SMTP id c15-20020a170902d48f00b001500b5b5387ls12470362plg.4.gmail; Tue, 01 Mar 2022 06:13:18 -0800 (PST) X-Received: by 2002:a17:902:c405:b0:14f:dff5:92a0 with SMTP id k5-20020a170902c40500b0014fdff592a0mr26240835plk.61.1646143998140; Tue, 01 Mar 2022 06:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143998; cv=none; d=google.com; s=arc-20160816; b=tqaVMCiIwaPpv8cU6eDrQm+HAQUJzkzNAkRYNuqKnUywGlvrYysd4KWt0PKXSq+lTE IvLFTxXFZQbiQqBckri4hyhOckXte8EtGk2I0x1n4yM1DlhL6jl7h6CAQ2VVNgW72CrC BYMEMtgOCTOKN5+bc72g80z2LM8TNuCp9ZrVTDIqq7I1vG0S0UZ4RZ9Vkiz3tRLXlKzq NfpuJ4bbvAVjTXUe0fayjUvYl8oIgHKXQrjkkzOXnRURkOONs4jqPK4esItkHOLs1e6S /mHSKwn9kjQ0o5MblLv89SsAJQiOqC2MWeJUErbxl1FhE5Hkg2kLdZnffUe9ko6IfwEV dGwQ== 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=7PQVaxp9YYvuXFR5oouUgHJS1okQ3AFQmwBRkeezcmk=; b=jEWOhJ8dhCSGVUn0quVB2EIFkxLF95bipG4Gt++sUCz03l1QnWhihFAPIY9exKPlgq dYh5kD4HETSKJsLu5+gsD0sk/xf6PU5dMY4zWNtBwkDXAW0yt2rriTmnJuqgeJogpif9 diNH0yjUXbWlK/D9lixh7lIgmnwTwc0Hr3N6gdzui6Omnc1Y6qrPU5aTdoBAL5sf1UqQ x31rtbCDABIhfntYMQHowD3UHcRPfwrmuTwoO9KZ/9GZE5lXOcsLqHFEawZdHHYW8fzM /jvmMpa2JA7G/IYUbdjWHTM+JVROVD4F6/9auFIrqRl3ntORvrUd3hSiMHQZGf3hjHPr jjZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kNzeZ7i0; 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 be11-20020a170902aa0b00b0014fe928996esor6838583plb.30.2022.03.01.06.13.18 for (Google Transport Security); Tue, 01 Mar 2022 06:13:18 -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:244d:b0:150:18f3:8e98 with SMTP id l13-20020a170903244d00b0015018f38e98mr25384278pls.28.1646143997833; Tue, 01 Mar 2022 06:13:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:17 -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 5/8] drm: bridge: nxp-ptn3460: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:44 +0530 Message-Id: <20220301141247.126911-5-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=kNzeZ7i0; 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/nxp-ptn3460.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index e941c1132598..1ab91f4e057b 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -263,7 +263,6 @@ static int ptn3460_probe(struct i2c_client *client, struct device *dev = &client->dev; struct ptn3460_bridge *ptn_bridge; struct drm_bridge *panel_bridge; - struct drm_panel *panel; int ret; ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL); @@ -271,11 +270,7 @@ static int ptn3460_probe(struct i2c_client *client, return -ENOMEM; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, NULL); - if (ret) - return ret; - - panel_bridge = devm_drm_panel_bridge_add(dev, panel); + panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); if (IS_ERR(panel_bridge)) return PTR_ERR(panel_bridge); From patchwork Tue Mar 1 14:12:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1851 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 574F43F0D5 for ; Tue, 1 Mar 2022 15:13:23 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id e3-20020a17090a4a0300b001bd4aa4cfbasf4341985pjh.6 for ; Tue, 01 Mar 2022 06:13:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646144002; cv=pass; d=google.com; s=arc-20160816; b=s8jRR2ckdDHhAD45m8TT+Tc/uhB9iXDl6e+Cuo9yJJg15WrXh6ITKFSIqWSMo69aGq QYGJ47/ed/9lWqQ+vaMODYNQAQPKAlK9hvAajYOe2nEuiRe5VwPiDusFbp+v4StHZuCO KOwkGJQZTqjwz2rx+dFsO9PyjTTtQiq/kwAPest3sZxdpqMtB4d6VG83UgY/H5piHucb aV/ddS25jP04xx7sReANTyNPKimpQKbQyahDAXTlNpQFsl4m/4kg8PqZkjXxhxKrpkqE CbpEJC39c69PKib8vAfYZskILGaUSK9rO6iJS7oC4VeA+X6+DrtcxeghqanfRgsLytGU 7w9g== 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=y/Ba9EuWl/gOYOHIJHfgH+/iyNWI7BkphAf6KVbx7Sg=; b=K21nUIrk5KDHpsa6p73MFb3H1wgQdTCl4S4yC4aQBVTou6WvRWgGqTbz4x6J6oLZZL QB+uFOhPzCsrHR4pCtEYPQ67prYoKqSf8rcnYdCetV5n+eqsmrv+Kjo1qV4o3YT0/xyF 7DC6Ny6AV95X8byM1MMdvrsW34wm7Y+yT4/X2vaW93krEKUolkHq+GlCxatCMtIBalAP hXC6z+WA6K6sEBrQiRkC4uJhKTotSx+XVbLHYT9IhPZlZpYOcqds16DfNTtsyJu/tGB0 FshW/HuxoGoXGR4JlI86qQmTbm4UVwwsOaQrpr32a4sCfScGDw6xN2ukbIf1H9rpNMVZ N2Sw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ky85ZWNX; 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=y/Ba9EuWl/gOYOHIJHfgH+/iyNWI7BkphAf6KVbx7Sg=; b=jcCnlaJzF1JvZsIFYTqKr00RCrPcCN8Hmt881ei5l6ThSifgR0dz3IC0qkvj+CjY36 MtL6whL39uTwVze/7UkCcltSUrCTDtwK3U+rR8HkGbxYCAqZaIFHoEp+lBKI5pfS05dh zsjSAYbjmpIcutEkackZ9/LGx4SjCk+DXd+H0= 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=y/Ba9EuWl/gOYOHIJHfgH+/iyNWI7BkphAf6KVbx7Sg=; b=gpih07ozYeRwI4xmo9QLrHTkczQo/C6j9amLm0bbwuOjrKvJ14kMxxBHfD8F8EbvX2 HSbLgdEp7mkVWFcQl7b4gZQvrHJlIUQKTbpxLqaEG64p1qoI0gfpAI+M63BPuS+4YATI G99GMja0Ne1C3lTwJnrDfUoKlYZZsoRnkJumEJ7mol3opzrR2K9f6Lj2HQh07HWBplN0 PhjzboTFEZwh8zdXwxfviWojmvnKF695YYXv5ceu3nA1F78tjEjKpiSZf3WetRNkPGPc Uv3zv1KLxiBoiRcrO0TXakqPqD6/l1tpYEgxj8QFXlGXKtsizoS0Tnlj9LyeumaqSLRe EzNA== X-Gm-Message-State: AOAM531WOQUGTi9r1h1+KKfQxTYUTEbaOSpCwxilL2GXmLEob03juDck zipa6DQ7swTqaPCFeh3MJZgEtHeA X-Google-Smtp-Source: ABdhPJxDPI/yAnluKGni0QPI82RlfogmeeZNTCI2U4CoRyFvcZ1tzPAiXQp5DazRPDH8ZCjOhme2Ng== X-Received: by 2002:a63:4c65:0:b0:375:5cc8:64ea with SMTP id m37-20020a634c65000000b003755cc864eamr21622993pgl.279.1646144002123; Tue, 01 Mar 2022 06:13:22 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:eb44:0:b0:378:a292:4507 with SMTP id b4-20020a63eb44000000b00378a2924507ls2805938pgk.5.gmail; Tue, 01 Mar 2022 06:13:21 -0800 (PST) X-Received: by 2002:a05:6a00:2301:b0:4e1:5842:48d7 with SMTP id h1-20020a056a00230100b004e1584248d7mr27752637pfh.14.1646144001465; Tue, 01 Mar 2022 06:13:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646144001; cv=none; d=google.com; s=arc-20160816; b=eQcdXV0GF2nFKI+z/ntegdtf3GfUCprde3FCXjV4Z8i4u7l2z6VAeYlE0gpjMdBEqc CYLGyy6+XkV69OVq9dPRZI9ExGK9k1GkK75BLqroOylZ1yxH9z5tLKpcJbSH86yA+wQy +tPLm8C0P8V1bt9SkjSWVCIibHHxLUB8+3i+t1/atCuDm62hyTHzh/dnAOrRmeLUs+RA 34PkpTH9mo3Hu2rnZnSQLhbzZAPTFbmVMlPM+ZXWbZDedWb92SxVU1rJEVqLz+zGdiL5 FgPFc4X2+2mtvZT8b0OtZVzd5pb+q6vv/gOdQzqzJVETNfli623uqdRsI545NS8Pz8Ob vSiw== 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=iRt+M+Ob+KcM1LrH93JuvfzptMSFKo5T03WLMF24Y/0=; b=fSwBHUtGUuP//MRf4nCJwe2SMeu+91KFx6Yyh4BVVZohtuegF4QCfoKJirOvyEIiJW kotCbqGf3C4ebkQnXSDd9I0/UbKJSdNj6EVBHyAB6ykZcmTA6R3vIaaaj9zIS571eKdP I+ida3Twiw+vz2W/BjbDPH5Ag63Z/VdNVLjXl48I7arIP6mp9c9IWQo+p8Tx/wKMkRTr ucxm8kSi0aKgeKpzDvhWOYFs7m/KLZ2DIB5XV9iD4mhe5T3KCLFkYwZoV1lAPQr0zY25 MIanKJA2a78GXMe9Iv8vf+vfIBG5ruOS/0/wpNRS1yxpmrdUYYYL/sb2AJ7hRkuWcDTu RLIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ky85ZWNX; 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 h6-20020a170902704600b0014fe9289973sor6520529plt.35.2022.03.01.06.13.21 for (Google Transport Security); Tue, 01 Mar 2022 06:13:21 -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:740b:b0:151:8479:3633 with SMTP id g11-20020a170902740b00b0015184793633mr2760060pll.152.1646144001150; Tue, 01 Mar 2022 06:13:21 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:20 -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 6/8] drm: bridge: parade-ps8622: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:45 +0530 Message-Id: <20220301141247.126911-6-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=Ky85ZWNX; 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/parade-ps8622.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index 614b19f0f1b7..37b308850b4e 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -452,18 +452,13 @@ static int ps8622_probe(struct i2c_client *client, struct device *dev = &client->dev; struct ps8622_bridge *ps8622; struct drm_bridge *panel_bridge; - struct drm_panel *panel; int ret; ps8622 = devm_kzalloc(dev, sizeof(*ps8622), GFP_KERNEL); if (!ps8622) return -ENOMEM; - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, NULL); - if (ret) - return ret; - - panel_bridge = devm_drm_panel_bridge_add(dev, panel); + panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); if (IS_ERR(panel_bridge)) return PTR_ERR(panel_bridge); From patchwork Tue Mar 1 14:12:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1852 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2C6273F0D5 for ; Tue, 1 Mar 2022 15:13:28 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id j5-20020a63e745000000b00378c359fac3sf2723011pgk.2 for ; Tue, 01 Mar 2022 06:13:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646144007; cv=pass; d=google.com; s=arc-20160816; b=cqpRpVqEcsftWZXYuQAlHCiRkg/dJzDL9VfRAh67Dym8vf5g0mFBf/aU05XyQT4eM+ GuuDyFfpOAugzNkPEsY9KdinFphXS3eoXbEs6y9VofsY7i+5o3+vWxwIcEThSo34l44+ L2hQaZNQ3QAFv2rPth7OfxRhe6WxhgPrToAnCgUyG7fcj9SIEfsVRP4ptN2g0kJYOiTX wNHWb5YnHBzRs+8LyzzXb8nqTNt/IsdybMEv5b/4BtoN4NqsxJJ9wp2N+hXufONl/B+d GgofDkoDIeQ3RnDpca76eWSO/nwYWIU98N3hWGVBamio0Cdn3TKJkjyON6MEje+2gEey ArlQ== 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=NAN1cENmpyMlsqlTMLw3syH9t9Bmis/Cb8BSeFwR6Qo=; b=VcoZsJGiYVXad7M52pBrC4Rw4GS9mBdn87cmiyGK/IQHOQThhewceeixkDo9IF0jwG 601I6apuRkbawox0EGlyWRYsa1doSOAu/4E1t5yXO/+8JXIl9AjWO7d9Gbu8AR5plekx HC2zWDyyEPkYLDQ3R7FQiVv/YvY+sbYpLJMn7aThW2pcxWFVGioJVe2Z/Kzf2n8auwLK RC/eQu5iDjS+acV3m2c46htjfgXad1PWlKgsO1/lSUwUeJwuEf/GM3uos2AF8nBB5Uof NFl94ZKZHPt2dSAr44b/rBzE+WqW2tuZRFUkGYy8nnl+/mjMwNQTb148QqcEyZtDKJVQ zVXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="hbF/WZKz"; 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=NAN1cENmpyMlsqlTMLw3syH9t9Bmis/Cb8BSeFwR6Qo=; b=PjF+m0bLFz6JHT7y0iPfw9hf8IXKMt51SJ2Gq7uQG302+PEfbRVAPhgFDxbINoQ7T1 E1+TttW+mYuf/+BYcFVWm+NnYfHpTYB40DkaA9S4ckraZrhV28HdBIEqb4169sqZGwiR l+MkE+dCvVyBkHzNX6Z2uJfKw+ClPlGv30eVg= 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=NAN1cENmpyMlsqlTMLw3syH9t9Bmis/Cb8BSeFwR6Qo=; b=l76Y13WI0sWims+2j16PV+U8lEu7io135dTexb4DPTCx6wP1IaNbp5mvm60X5BO2jh AYieru+XWUKT2GxJ9Zc+t/NiCcDwGZU7Tw3zSEOwMggTTF+aKDDzgP8elCl7AWTSWMEm DRcnJbW9hInnVJMM0mZJCOFh4QHUPhsum8J7mT+ydC+XLFG82hFvoEqK5v1bB7Dqjdyi ho6WgD+BGCDlEPNXRZGyX7+bwwscju0abbkXYoaCgofnS6fvZqqsfT92LCNu5EuMj8pM NAQ/YZN3YKGRRa9r79D2ypp5YirIkQ0ob4nBvimlQ0ypLSWqA/WUpQhk1uDWCopbm5bQ 1aQQ== X-Gm-Message-State: AOAM533OSiRlPalC2fUt8Ls3NOWqKrezIrYVnThnMsscNO6S8DjuTx7R BXk9ldG2ax5GynW+u9ghb3PzVzsq X-Google-Smtp-Source: ABdhPJzgy20bwUXYnA4vm7A5GSWLcIGnBtg264CadjSKKkfOFLVt4MX+wsryv+H2l92FAnMCxwlBeA== X-Received: by 2002:a17:902:aa84:b0:150:8d6:bdec with SMTP id d4-20020a170902aa8400b0015008d6bdecmr25303740plr.118.1646144006965; Tue, 01 Mar 2022 06:13:26 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ecce:b0:14f:d9c5:79c0 with SMTP id a14-20020a170902ecce00b0014fd9c579c0ls12465503plh.5.gmail; Tue, 01 Mar 2022 06:13:26 -0800 (PST) X-Received: by 2002:a17:90a:a58e:b0:1bd:4752:90cf with SMTP id b14-20020a17090aa58e00b001bd475290cfmr11198905pjq.54.1646144006202; Tue, 01 Mar 2022 06:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646144006; cv=none; d=google.com; s=arc-20160816; b=0rS9b5IE04QE6rdqWI/Go2yQjaFFTjRbA/BjZ1Q0Ur4e2dUPdgTURLDSwf5PwkSh82 C9aNWHuR+02Jqogeqky12Qym8xqUYGdj9XlTgJM9rC38TTGJPAAyxTvjsu//nG3ntOya X2ove+47KVKDyv09iHfsPSu1h8mxMHb64439IMrg6tVghhYDfuJEFVwyJEkmMEP/AdbY 8a4b4Qf7jol4vmNZEZRVWgTc+vKRvdZvPlAO1RWl/Ga7un6A+i+biPukM9TZJJd3g9Mu FHJ9Nf9uexa+AfdvTuMMD8NyEewwPiZ9mEfg0IPC00nQyjrci1pSfF8mXcR2NXqR9lyx 55Ug== 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=qaTZu9FvVrqWlSDXwnXpKy5XmlDOhQcTJsIWX9eI4CQ=; b=ix3HqjdsG42SR95hg06/irxV8W+oz15/FtZHItwZ0zn/P5dZkNlzQkAnJ9B5ERJkId WTfGntkLcyvOcSWHZrMrU/PTYfZBCEZSBM0vaXlmCKhOHFOix/X1HZPI/6//JqRw3Vjc v5t6J+pf4CO3vKPrpMtASW0tCIMnsEkQk+YoAawJbTy8bN/55roM1IoUlBPE0iep+O0U x3l+F1LDQ24zMewr6CcUQK1QADMMcRvH6rj3CzHhiaP82QCq+I8Za36tXaCTnYPLoN9a JtUhnN52JsgEHy+LKC8nO2jXXx7Qma5Pk0qi0AVwQNyQzkpkrPZ0PqiEqUZ0jdaoDf+E r9xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="hbF/WZKz"; 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 l13-20020a170903120d00b001516eb5db81sor2499290plh.41.2022.03.01.06.13.26 for (Google Transport Security); Tue, 01 Mar 2022 06:13:26 -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:ba88:b0:14f:9ef3:f80f with SMTP id k8-20020a170902ba8800b0014f9ef3f80fmr25381276pls.170.1646144005914; Tue, 01 Mar 2022 06:13:25 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:25 -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 7/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:46 +0530 Message-Id: <20220301141247.126911-7-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="hbF/WZKz"; 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/analogix/anx7625.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 9aab879a8851..f7c911104464 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1606,8 +1606,6 @@ static int anx7625_parse_dt(struct device *dev, struct anx7625_platform_data *pdata) { struct device_node *np = dev->of_node, *ep0; - struct drm_panel *panel; - int ret; int bus_type, mipi_lanes; anx7625_get_swing_setting(dev, pdata); @@ -1644,16 +1642,7 @@ static int anx7625_parse_dt(struct device *dev, if (of_property_read_bool(np, "analogix,audio-enable")) pdata->audio_en = 1; - ret = drm_of_find_panel_or_bridge(np, 1, 0, &panel, NULL); - if (ret < 0) { - if (ret == -ENODEV) - return 0; - return ret; - } - if (!panel) - return -ENODEV; - - pdata->panel_bridge = devm_drm_panel_bridge_add(dev, panel); + pdata->panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); if (IS_ERR(pdata->panel_bridge)) return PTR_ERR(pdata->panel_bridge); DRM_DEV_DEBUG_DRIVER(dev, "get panel node.\n"); 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;