From patchwork Mon Dec 18 10:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13496611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E7EAC35274 for ; Mon, 18 Dec 2023 10:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ckbKdZlpmiVZeJe2rigKncWmkt6hW0AyGI6xzHyLmZQ=; b=pIw/UHQEIPFain /r53LYe6g8auuoNKQ0LHLIeG014J62eD750yo+wYa+Uy+d/81bE9W8x2+AAxsGZDludIxVnWhihjz fDEyf0hM55TwtnBo+bsbmxAjP38nK4ay9r2QbvgWJFz7v71t1u1Fv+5OMH1pPgZdDejsE4uVDkzcF xUspk8vqqQAae+mKyhQG1qpzbcB8yticv6cM3zlUwIsZEbJq0Vf+idyNdeCRZlEeAkpCTrghnsyzr bCvouYnoOCxFw40mmu6TnEEE5Ckf0+cPXbdkZnKXl8LBnYmzbkfdFvLKpUx4b0B4SPPBqeDCx8Yqx pi7GeT58DEyNtmnX1bDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFBJb-009wkK-16; Mon, 18 Dec 2023 10:57:39 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFBJM-009wav-2u for linux-arm-kernel@lists.infradead.org; Mon, 18 Dec 2023 10:57:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702897044; x=1734433044; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gAuxvxpZNby/nD/WwNhshNTVTgcfNR7TyfNbdg9IQig=; b=MQXXjCu1h66QxILu1n/o1K5whstHMdAzbyounZmjLFjS4jgtDZflq/Yr 4+BZNqp11Hdt/UxYCepltidGghLt16iDuQL0k+CrXM+bIUDpigIAxk/ga cOxSP1Q50hHyQHvbjsqvrkTU49W5fYkkRmxDlkQ6BUKw6JcLT70bAG//I sJc8bemI0fw9RIAFvzb+TeYp1JpNklzIWNxRaa79EwTVhoVp6Gi6X0+AK 8wTlPtU/OgfnfyQY76mmTT2sWrIIBGzAyZhBfEXdEH6CkbURUwPe0DU7y Z86e6SkSoTs92GNNRBLRffi7Wq0Bm1r4xueyy1TVW8PyKbz7+/74gnAcZ Q==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559831" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Dec 2023 11:57:21 +0100 Received: from steina-w.tq-net.de (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 1E73E280075; Mon, 18 Dec 2023 11:57:21 +0100 (CET) From: Alexander Stein To: Liu Ying , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/6] drm/bridge: imx: imx8qxp-ldb: Use dev_err_probe Date: Mon, 18 Dec 2023 11:57:14 +0100 Message-Id: <20231218105718.2445136-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231218105718.2445136-1-alexander.stein@ew.tq-group.com> References: <20231218105718.2445136-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231218_025725_322616_28901BD4 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein --- drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 37 ++++++++---------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c index 7984da9c0a35..423196d2204d 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c @@ -557,10 +557,8 @@ static int imx8qxp_ldb_parse_dt_companion(struct imx8qxp_ldb *imx8qxp_ldb) imx8qxp_ldb->companion = of_drm_find_bridge(companion_port); if (!imx8qxp_ldb->companion) { - ret = -EPROBE_DEFER; - DRM_DEV_DEBUG_DRIVER(dev, - "failed to find bridge for companion bridge: %d\n", - ret); + ret = dev_err_probe(dev, -EPROBE_DEFER, + "failed to find bridge for companion bridge\n"); goto out; } @@ -590,22 +588,14 @@ static int imx8qxp_ldb_probe(struct platform_device *pdev) return -ENOMEM; imx8qxp_ldb->clk_pixel = devm_clk_get(dev, "pixel"); - if (IS_ERR(imx8qxp_ldb->clk_pixel)) { - ret = PTR_ERR(imx8qxp_ldb->clk_pixel); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, - "failed to get pixel clock: %d\n", ret); - return ret; - } + if (IS_ERR(imx8qxp_ldb->clk_pixel)) + return dev_err_probe(dev, PTR_ERR(imx8qxp_ldb->clk_pixel), + "failed to get pixel clock\n"); imx8qxp_ldb->clk_bypass = devm_clk_get(dev, "bypass"); - if (IS_ERR(imx8qxp_ldb->clk_bypass)) { - ret = PTR_ERR(imx8qxp_ldb->clk_bypass); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, - "failed to get bypass clock: %d\n", ret); - return ret; - } + if (IS_ERR(imx8qxp_ldb->clk_bypass)) + return dev_err_probe(dev, PTR_ERR(imx8qxp_ldb->clk_bypass), + "failed to get bypass clock\n"); imx8qxp_ldb->dev = dev; @@ -640,13 +630,10 @@ static int imx8qxp_ldb_probe(struct platform_device *pdev) } imx8qxp_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, "lvds_phy"); - if (IS_ERR(imx8qxp_ldb_ch->phy)) { - ret = PTR_ERR(imx8qxp_ldb_ch->phy); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to get channel%d PHY: %d\n", - imx8qxp_ldb->active_chno, ret); - return ret; - } + if (IS_ERR(imx8qxp_ldb_ch->phy)) + return dev_err_probe(dev, PTR_ERR(imx8qxp_ldb_ch->phy), + "failed to get channel%d PHY\n", + imx8qxp_ldb->active_chno); ret = ldb_find_next_bridge_helper(ldb); if (ret)