From patchwork Thu Mar 31 15:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1897 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 AB6FE3F0D7 for ; Thu, 31 Mar 2022 17:45:34 +0200 (CEST) Received: by mail-pj1-f72.google.com with SMTP id iq24-20020a17090afb5800b001c685a314d6sf12578146pjb.4 for ; Thu, 31 Mar 2022 08:45:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648741533; cv=pass; d=google.com; s=arc-20160816; b=HVGqek35nxiRPbb633gK3rTJWFP3NN541NOHrisJWJDf2wOI6T2yBTZd5czjMYNbiE 2njsoeIcPjiWaXORUmRghuEbP1V3XVwznrKYwefQ7DsdWaclLVilN8eRZQzWOxGRh44z wRHSAqCNHC8Cm0ohI4UVpSZochMUN33Nv7uJc/uTaMdGkrHBvHYqaJf2bG+afcEYWEYg 5FB/tby+DnUrIk/VZXwqYqRb1OlXHBei+UNco6SK3NF/3wGVEP1poDF9Bg61cmT8NSnG IhyAyfvZzbKMH8z5loCv/SviYReF6Y8/bvFFoWYYCH8GyQpQkUXyqW3F+DskXvGh250u aMFA== 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=v6jyb4edX/ILgdaKoFt6cg16wNm1Y9w0mxtnz3WaJPg=; b=rOFHH7giJUAc6lza0vbQ7wPRTz92vfFpcaAfp8/fRc80cOxnfegX6s1Mp19b18xQLu sLIHQZ1vLsQD1Ju6FYaY2EcY6SulZi2xrD2M5mRlZ510MaE67TNBlG7QnWDKt4NjZc6s qYva8Q5UuVNe4v9PX4VBIhZQt1mYPyZU4KSpMnPlwlrSyZVXu6R/E9xgmjmUgxRnW+0C fJ2NXSMuh6zWKOE/HpG4s1lIBTC2qJ/CPlLzEKKaoruBuazD+EvzQSPbXevdWVadc0sQ j8zNcg+EbPH6QGgv1XSzc1XamaRrONVj6sg/k5CxfpOddIdbnkX+P4zxDexQLrKve+lq 8RyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j5B6gbrH; 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=v6jyb4edX/ILgdaKoFt6cg16wNm1Y9w0mxtnz3WaJPg=; b=NtmxS9fqCNlO74Bqp9hOyXIAqB/KdnEdrCDsSLWCdqUDZWvcx2NZj4CufvWz+MXftT cI497g06eWLMeJlRCFfW21rblObneH6AYInP0GetIC/fqmHF8cIkHUJ2ms35x3luCoAt j+gJ32cUfDtATR6xoptZy/NrSrhDs1WJS4R+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=v6jyb4edX/ILgdaKoFt6cg16wNm1Y9w0mxtnz3WaJPg=; b=ObGxN2X3nJLCd1IVdJVhgzxDCspqTP6BD+0ov8RMq9uHOJxZSZLzQ4HwqP98LQ5hCS RtuZ0gViMgbWQ6/tz08O3YzbuywEZ9Ae9sm4joj0FSS4XTpIeYHCek8uBqCGVXNa2ckY vz2Am2kk2ATP+ChYJ9lou/xKpVH9WCn5g5Jy5eXzrbl05p8XPKfVnhchDP9Vnwn45yH4 4w1lqDx0GItg5QUi+ikoRT0luGW2eSyoI21EioFPaE89qRUBlS/MYuaLssUEnAqcPPxa 0H/Ya/eCo5wEkfWAQlNofcJKrM5YRprkV3JxsO8imXNCg3Ez9SK1LXEeiiLwwrX4Pi4K d+UQ== X-Gm-Message-State: AOAM530zGr3cztC6ybnMBllQIt05G/0GCngVs3ziYJSaN47ykNryDpJB TJCHBbsUkzHLu2INy03UC/oBpWUt X-Google-Smtp-Source: ABdhPJy8vJsPPZL05jQ2ZKJMwpRXPdXsmn/5s5FEJyQkiPsksOJMB5TyMLh4LnkS3wZNU0QdUBv9Mw== X-Received: by 2002:a17:902:a9c2:b0:156:1859:2d05 with SMTP id b2-20020a170902a9c200b0015618592d05mr6127477plr.86.1648741533441; Thu, 31 Mar 2022 08:45:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3143:b0:1c7:5cee:3950 with SMTP id ip3-20020a17090b314300b001c75cee3950ls2850464pjb.1.canary-gmail; Thu, 31 Mar 2022 08:45:32 -0700 (PDT) X-Received: by 2002:a17:903:30c4:b0:153:c102:8b9a with SMTP id s4-20020a17090330c400b00153c1028b9amr41812282plc.21.1648741532670; Thu, 31 Mar 2022 08:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648741532; cv=none; d=google.com; s=arc-20160816; b=MGzRh6elT8GZjCEOKuJVeYLc4KoNfXDvBaZe/3t7jDWRY6UD91E/sv9H2ByAZgIXwd NiC4ubxSFWk2s4g6k0bj8TyWxINTqhOa/YgbJEjV2DSQ3gwQIUPPr6Ue9oH/MP6wswgr oy5c1eTGGSZt3KJg3hpS/OXQNaNpTxGlJitj/KbO5LbTz6Ak24BjsHSYBSU+kCI4YNak qIs3xZsEsSia7oMtE0kC5ELZh+UymfgrrUQrdyjPH5vsye9AOry88q8t0kDIl0ARMD7G erX0xDQo7YnoWJ9EiZ7o4+DsZYe6jbqK+AQfs6SjwzYI5uGuedKmhcPEPB/FSd8PMZD7 1o2w== 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=2mzvnygYESinmJ04gWOHbIrTmnMi9ZDExacYAJdSLbE=; b=TPI0z3LNly4Mi/av1USkBCSrX97Zwce3hYCTyRK0W6ErA/fB/4xUyu7sGUduA2JYw8 d0u/7EG+XzdS4Yc+bq5MgtY+oeQZeaMrfyS2yA1pzYKItsh70PeFgFeXuhv8FhHVNJj2 gJJULEP1VnE0FA7HV0BySbnfBsNxYvhXq9rNkMaCHOCcAMdyaL1FWpk+ApAzP7cy9p2P 5RZrA8EdWyGb1SWDmdsGfbcT/AnsNj1BiTM7QPMBRD6voRWkek6Htblf3+JomQ6A9LPz rpdzjBTH+kqQW9zz6PaZOKuvEgvXd6Zy0nnsy+ZB1nCEkZx8tUtNtteWsDxjPHnJqKMl v7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j5B6gbrH; 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 125-20020a621583000000b004f3bc62a688sor10060428pfv.55.2022.03.31.08.45.32 for (Google Transport Security); Thu, 31 Mar 2022 08:45:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a00:1145:b0:4f6:3ebc:a79b with SMTP id b5-20020a056a00114500b004f63ebca79bmr6043226pfm.41.1648741532234; Thu, 31 Mar 2022 08:45:32 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id g1-20020a17090adac100b001c67cedd84esm10205684pjx.42.2022.03.31.08.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 08:45:31 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart Cc: Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v4 4/5] drm: bridge: dw-mipi-dsi: Switch to devm_drm_of_get_bridge Date: Thu, 31 Mar 2022 21:15:02 +0530 Message-Id: <20220331154503.66054-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220331154503.66054-1-jagan@amarulasolutions.com> References: <20220331154503.66054-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j5B6gbrH; 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 Reviewed-by: Robert Foss --- Changes for v4, 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;