From patchwork Fri Sep 10 13:09:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12485119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90F25C433F5 for ; Fri, 10 Sep 2021 13:10:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B20661153 for ; Fri, 10 Sep 2021 13:10:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B20661153 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 206A46E9F4; Fri, 10 Sep 2021 13:09:58 +0000 (UTC) Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id D780D6E9F4 for ; Fri, 10 Sep 2021 13:09:56 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id C00052B012A6; Fri, 10 Sep 2021 09:09:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 10 Sep 2021 09:09:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=foGgf4V/HXkaP 7N33tq+jhHErQtWL7Z9BGtAet+z27I=; b=LKhgWSRFkIIsq/dG12LOeNfVg8U8k ePm/Rq+vb60VSLQzpOjNeEd6MsAMgo+s+GVUx3N1FVxCx6JnDzFyJ5pVy+0U7lI1 cea9iqGdFOZWVsWDL1PQ6hh+7j1mRG85WRKdRkwRAbwjdmzd3SynAzEpN0CqVRYQ aq95Zw/2diP2EwZ1r4Wvh+t+CqgLuXNcliqOW4wRAp6J/fyHvl4XP5nDMrMyX2kg ddRvpqV0bqCUdY61O/ERBDL7mz0aMJv5T/pUQkQ4WOgyMJEqvRCDelPalcL8hKML FAdT7DlTfHGBnRl9J2oa522XdhXo+J8uOhQtkHPHgThfywKbk+qyZnCwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=foGgf4V/HXkaP7N33tq+jhHErQtWL7Z9BGtAet+z27I=; b=BlHnIi76 OkVX1M9BaXvCg9sAfie2Q3UsGsNC8o2D5NRffvyeWF2e8+GxEqwqNG5UyNEd/hgM aZKKz5T8faKVhBxee/yMB81h1xoZu4oY4mFdeYMZ0R7UDy9sEp5wqUrR9yidWjr3 rdeestSlCYy7d7gZPD1+vuDLVyXI2H7fkkgrQz3qD7OqqPD9NCLG1U/ITh54/+r/ DFJBvXb7t0VAH9lPd+mCZ+yx7QQ8d1+nVGLfPf0V57UpMRAWW4sTli1U5jMeZEsY iUCb7kSD8Kq2/2yulTfQ0aOLwcpaPXqDhLd/y4xrR8XFUrV2OdCNPmItbB18sDC8 Y8WFDre7E6P/AQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeguddgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 09:09:54 -0400 (EDT) From: Maxime Ripard To: Robert Foss , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Laurent Pinchart , Jernej Skrabec , Andrzej Hajda , Neil Armstrong , Jonas Karlman Cc: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/vc4: dpi: Switch to devm_drm_of_get_bridge Date: Fri, 10 Sep 2021 15:09:40 +0200 Message-Id: <20210910130941.1740182-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210910130941.1740182-1-maxime@cerno.tech> References: <20210910130941.1740182-1-maxime@cerno.tech> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The new devm_drm_of_get_bridge removes most of the boilerplate we have to deal with. Let's switch to it. Signed-off-by: Maxime Ripard Acked-by: Sam Ravnborg --- drivers/gpu/drm/vc4/vc4_dpi.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index a90f2545baee..c180eb60bee8 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -229,26 +229,19 @@ static const struct of_device_id vc4_dpi_dt_match[] = { static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) { struct device *dev = &dpi->pdev->dev; - struct drm_panel *panel; struct drm_bridge *bridge; - int ret; - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, - &panel, &bridge); - if (ret) { + bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); + if (IS_ERR(bridge)) { /* If nothing was connected in the DT, that's not an * error. */ - if (ret == -ENODEV) + if (PTR_ERR(bridge) == -ENODEV) return 0; else - return ret; + return PTR_ERR(bridge); } - if (panel) - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DPI); - return drm_bridge_attach(dpi->encoder, bridge, NULL, 0); }