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); }