From patchwork Mon Dec 18 10:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13497478 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B001CC46CA2 for ; Mon, 18 Dec 2023 19:15:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1846B10E396; Mon, 18 Dec 2023 19:15:38 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3FEB10E390 for ; Mon, 18 Dec 2023 19:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926928; x=1734462928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f6bpzhwW9R8BYF0pBX9Lwvsu/ntZ/dkI6vpAeUOsKdA=; b=Jo+AgxTLjzZg1Olxj53rbRstQ0DOgEWJZDcnNwM+1wxExZza5h7doomR wf4pV5opGFAz6KHG+3Q7l3u9/MbqFCrTRlHmirtoy/wSS4g9Jys3i5mKQ mzq6ohkm3+gg9M+9yu+wGHS+BBIp0nB+VQaTwiz7m/3XBaTRwvxbjwVMT 7vocQkIYx5WQjWQQRX0SkurMSwCDdh2ex6u763SUJvnjvXsLXk4EqFw+L ERYni5AtdtrJNWwPhR1Pyn85cT8rNuHMHeZGPutcdmKba+9cUpZr172NR yYtBEuLmHvnbgkEvnCT/s61PgYsqst29B9ZvwfoUwLs5Djx5rJYWmuK05 g==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559830" 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 BDD10280084; Mon, 18 Dec 2023 11:57:20 +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 Subject: [PATCH 1/6] drm/bridge: imx8qxp-pxl2dpi: Use dev_err_probe Date: Mon, 18 Dec 2023 11:57:13 +0100 Message-Id: <20231218105718.2445136-2-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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein --- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 26 ++++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c index 4a886cb808ca..3a1d5795d002 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -403,20 +403,12 @@ static int imx8qxp_pxl2dpi_bridge_probe(struct platform_device *pdev) return -ENOMEM; p2d->regmap = syscon_node_to_regmap(np->parent); - if (IS_ERR(p2d->regmap)) { - ret = PTR_ERR(p2d->regmap); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); - return ret; - } + if (IS_ERR(p2d->regmap)) + return dev_err_probe(dev, ret, "failed to get regmap\n"); ret = imx_scu_get_handle(&p2d->ipc_handle); - if (ret) { - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to get SCU ipc handle\n"); p2d->dev = dev; @@ -427,13 +419,9 @@ static int imx8qxp_pxl2dpi_bridge_probe(struct platform_device *pdev) } p2d->next_bridge = imx8qxp_pxl2dpi_find_next_bridge(p2d); - if (IS_ERR(p2d->next_bridge)) { - ret = PTR_ERR(p2d->next_bridge); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", - ret); - return ret; - } + if (IS_ERR(p2d->next_bridge)) + return dev_err_probe(dev, PTR_ERR(p2d->next_bridge), + "failed to find next bridge\n"); ret = imx8qxp_pxl2dpi_set_pixel_link_sel(p2d); if (ret) 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: 13497474 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0E698C35274 for ; Mon, 18 Dec 2023 19:15:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A584010E39A; Mon, 18 Dec 2023 19:15:29 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 42F4610E392 for ; Mon, 18 Dec 2023 19:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926929; x=1734462929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gAuxvxpZNby/nD/WwNhshNTVTgcfNR7TyfNbdg9IQig=; b=B/PWZh+KbUucNS2QTz6WfGoAW0U1jE9GuuQ7+CRw3g73e9ipwXTPKVP+ NUC/124XqtKFAoqQVVeF/g5vPjEi8I0xy6bXVQjTmAeJuDQmz/SvyNWnH gZ+PyyQ62Sz8dXZmKeAN/1YXSeBhdzXYY+Z2h6QW6GoVRUHUlVNdQWtid edR4fBvYGJRxCgkD9mvFhQcij0/S+PrclR/Gug+uQreDdxh0LTsY93nhM fvDYUtl8TbCuPNhMjzdh8qf54J0dUadnFquj2Y92Uyh2FDJSt2CvxiX5B nDnd8laycMuzV+5JU9l0bJpvkSXvT4jcKBGL+bunFVAeU5O/z3Z1RnkXF A==; 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 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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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) From patchwork Mon Dec 18 10:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13497475 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C96FFC35274 for ; Mon, 18 Dec 2023 19:15:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46EB010E3BA; Mon, 18 Dec 2023 19:15:30 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 890EA10E390 for ; Mon, 18 Dec 2023 19:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926929; x=1734462929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2lv189ze1HjPcTpyti3gs1HfX3zuxk+ObuRHYy8a0Yc=; b=CzNalZDIBgUEr9n3fkdXrTdnSfy7Mm9sArWl86VBnD+2lGY8QO6Oxlo/ y4twLHdPSOMD/9z6YqDMdKT63oufJuH2a+4hMLhxMRkvQb+lYIkKA16BH 5j8ZTwtYmLAGUa966nk/+X8nBzoOP8lsmr4iyl6m7djptnIoaQdePzmXy 8xS1imLEymVpiEAOQ4SzAr2gLvGLSaAwhANqPhqhjg5bEoDEM8WC4nG2K Iv/hoMGF8O9Wikn2aqYgc0EY44V20rUijHSW5mNxFJrBoaJp3CgqQDsHu 9i9yT3BeUApncvX98TDRjPVATECu+Ru98t4eW70qfVBXQMmwMEawRwFJp A==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559832" 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 71814280084; 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 Subject: [PATCH 3/6] drm/bridge: imx: imx-ldb-helper: Use dev_err_probe Date: Mon, 18 Dec 2023 11:57:15 +0100 Message-Id: <20231218105718.2445136-4-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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein Reviewed-by: Francesco Dolcini --- drivers/gpu/drm/bridge/imx/imx-ldb-helper.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c index 6967325cd8ee..9b872cfb849c 100644 --- a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -172,7 +172,7 @@ int ldb_find_next_bridge_helper(struct ldb *ldb) { struct device *dev = ldb->dev; struct ldb_channel *ldb_ch; - int ret, i; + int i; for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { ldb_ch = ldb->channel[i]; @@ -182,14 +182,9 @@ int ldb_find_next_bridge_helper(struct ldb *ldb) ldb_ch->next_bridge = devm_drm_of_get_bridge(dev, ldb_ch->np, 1, 0); - if (IS_ERR(ldb_ch->next_bridge)) { - ret = PTR_ERR(ldb_ch->next_bridge); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, - "failed to get next bridge: %d\n", - ret); - return ret; - } + if (IS_ERR(ldb_ch->next_bridge)) + return dev_err_probe(dev, PTR_ERR(ldb_ch->next_bridge), + "failed to find next bridge\n"); } return 0; From patchwork Mon Dec 18 10:57:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13497479 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7DE8DC35274 for ; Mon, 18 Dec 2023 19:16:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2E9310E403; Mon, 18 Dec 2023 19:16:12 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A30410E396 for ; Mon, 18 Dec 2023 19:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926929; x=1734462929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ues8RonNkqtXNeQTmjHWB7sVdRAozhdTlsj5rYeL0Go=; b=QhQDr8skG8veRw7noIztetwPiEZFIf94e/PQxch+ytOA2YmcPBJ2Nhcj brAMeCC33VekH6dP73o4X+czaNOQ6zlnekmc/9eAI9PozcU/8zrLzSZdI gJTgFPITIq06JzdjdKpE0c/xtkMZ9Dyk/noh2ZVwbPDafjVjxnH0Icopp 76vEFXLpcngxNSxq/A9TwjvHOLrmvNdUOTdzSkyJiw+wp+lYMCN2tA0iX 8YfLBxrznGUr3xWXMOG3mVp/Fv+3FbttJjuqfU/aN2LVLUxvF9ewAn/vr Le4b89jWL4ZLFk4w583lKhkbuIgWf86fy6Z8zjtqr3aMpBB4yo8Zj2VB6 w==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559833" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Dec 2023 11:57:22 +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 C4F08280075; 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 Subject: [PATCH 4/6] drm/bridge: imx8qxp-pixel-link: Use dev_err_probe Date: Mon, 18 Dec 2023 11:57:16 +0100 Message-Id: <20231218105718.2445136-5-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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein --- .../gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index ed8b7a4e0e11..b8cc1df3e572 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -338,12 +338,9 @@ static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) return -ENOMEM; ret = imx_scu_get_handle(&pl->ipc_handle); - if (ret) { - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, + "failed to get SCU ipc handle\n"); ret = of_property_read_u8(np, "fsl,dc-id", &pl->dc_id); if (ret) { @@ -379,13 +376,9 @@ static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) return ret; pl->next_bridge = imx8qxp_pixel_link_find_next_bridge(pl); - if (IS_ERR(pl->next_bridge)) { - ret = PTR_ERR(pl->next_bridge); - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", - ret); - return ret; - } + if (IS_ERR(pl->next_bridge)) + return dev_err_probe(dev, PTR_ERR(pl->next_bridge), + "failed to find next bridge\n"); platform_set_drvdata(pdev, pl); From patchwork Mon Dec 18 10:57:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13497476 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AB588C35274 for ; Mon, 18 Dec 2023 19:15:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7853D10E3C2; Mon, 18 Dec 2023 19:15:30 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 59B6610E390 for ; Mon, 18 Dec 2023 19:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926930; x=1734462930; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LF02UyNK/xpkLqe9tr31YIzv+kTaNRG9vqb7cPz4ldI=; b=XNjCPprALbsqTe6F/o7m35kGpueJQI7CFY74Juwmh3lnDlTe8frFyPNR dFRJI79ir7zQ1vfAzOru6b5UfBdYoTztpBM1HiBLQyNGsoNOvwxotKdBJ 3cJmq0DQDJW0B7o+Ir/jLJvMpkuU6T2ago+fUn1bJ/iLwgxCJtGiCqp5+ vM+C+dGHegtn90TEfht24g5RN2QF2h/cFk3wDxHkY3/S06s4ETR8pCBtQ DfMtDJrWLoA9S1/ACaOPRSFjc08TydWfvPkgync/QndoYBy/wpGOt2JdB bTtxbz89nj8pc9ffjE3TfIx09TmlD9XjGgB6UK/6TPjQJuDNrO/YWC4KJ A==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559834" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Dec 2023 11:57:22 +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 24E1F280084; Mon, 18 Dec 2023 11:57:22 +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 Subject: [PATCH 5/6] drm/bridge: dpu-dprc: Use dev_err_probe Date: Mon, 18 Dec 2023 11:57:17 +0100 Message-Id: <20231218105718.2445136-6-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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein --- drivers/gpu/drm/imx/dpu/dpu-dprc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/imx/dpu/dpu-dprc.c b/drivers/gpu/drm/imx/dpu/dpu-dprc.c index 261c9566721e..6467ad960080 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-dprc.c +++ b/drivers/gpu/drm/imx/dpu/dpu-dprc.c @@ -612,7 +612,8 @@ static int dpu_dprc_probe(struct platform_device *pdev) dprc->prgs[i] = dpu_prg_lookup_by_phandle(dev, "fsl,prgs", i); if (!dprc->prgs[i]) - return -EPROBE_DEFER; + return dev_err_probe(dev, -EPROBE_DEFER, + "Failed to lookup fsl,prgs\n"); if (i == 1) dpu_prg_set_auxiliary(dprc->prgs[i]); @@ -623,11 +624,10 @@ static int dpu_dprc_probe(struct platform_device *pdev) ret = devm_request_irq(dev, wrap_irq, dpu_dprc_wrap_irq_handler, IRQF_SHARED, dev_name(dev), dprc); - if (ret < 0) { - dev_err(dev, "failed to request dpr_wrap irq(%u): %d\n", - wrap_irq, ret); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, + "failed to request dpr_wrap irq(%u)\n", + wrap_irq); platform_set_drvdata(pdev, dprc); From patchwork Mon Dec 18 10:57:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13497477 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C2D6C35274 for ; Mon, 18 Dec 2023 19:15:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 180BE10E38F; Mon, 18 Dec 2023 19:15:38 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4E4310E396 for ; Mon, 18 Dec 2023 19:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1702926930; x=1734462930; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fddthYdTBT69uFgmETEmEISCHIBOg8BtXB5X4yHA0g8=; b=TRH+RlrHY2Rw17bk9DjB99l1Sn2WnskV5ebP2czUhRrXPLCHpLORh6B3 mNRyvozXPezIlmhXrlfwwr2SRwkcAJigmx9VOTXFpePknJKsdk/ILGMUW ENnvJN73BeQM6zIIkZmGuGman4R6t+H0HOBn5VRJGlI6wHwxqZxRrENtM whIw1F8FqwgRuDX+Ke912o8BEOHrjgcVXBQILI3qJc2AAdedsiWY7RU6i qqxCzeZkXBmt0aR3b+piZlI6c1Aq4Ho0dG7RJL3NgPRcOqhmN+zzROibR d4gN7s7hWrULwo6oDyJYcx2yTN56X0nDnAn+3uGwIKje+SWiFdYXqInXe Q==; X-IronPort-AV: E=Sophos;i="6.04,285,1695679200"; d="scan'208";a="34559835" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Dec 2023 11:57:22 +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 7ABC4280075; Mon, 18 Dec 2023 11:57:22 +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 Subject: [PATCH 6/6] drm/bridge: dpu-core: Don't print error on -EPROBE_DEFER Date: Mon, 18 Dec 2023 11:57:18 +0100 Message-Id: <20231218105718.2445136-7-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-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: , Cc: Alexander Stein , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" -517 errors are just annoying. dev_err_probe can't be used here either as this would hide the error message already set in us->init. Signed-off-by: Alexander Stein --- drivers/gpu/drm/imx/dpu/dpu-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/imx/dpu/dpu-core.c b/drivers/gpu/drm/imx/dpu/dpu-core.c index d6116b3e4ed7..ea2558a14a6c 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-core.c +++ b/drivers/gpu/drm/imx/dpu/dpu-core.c @@ -592,9 +592,10 @@ static int dpu_submodules_init(struct dpu_soc *dpu, unsigned long dpu_base) ret = us->init(dpu, j, us->ids[j], us->types[j], pec_ofs, dpu_base + us->ofss[j]); if (ret) { - dev_err(dpu->dev, - "failed to initialize %s%d: %d\n", - us->name, us->ids[j], ret); + if (ret != -EPROBE_DEFER) + dev_err(dpu->dev, + "failed to initialize %s%d: %d\n", + us->name, us->ids[j], ret); return ret; } }