From patchwork Tue Jan 7 14:38:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13929097 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8385F1F2374 for ; Tue, 7 Jan 2025 14:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260766; cv=none; b=MaPAGINuJXBRKuMH7jwWAAw16MTCXuWspfhTB8R3I2/U4l7DrCYDaS26xDbO1EBLhUtMm1b8HcMArpCq5qh8a6MMkK7NhLvlwwCTtc6l5SMehrehlyfAvZk1GeCJpTerFfvqbQE5AreF8Mr2tC3feicsMWFzb/iECeYnscra+RU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260766; c=relaxed/simple; bh=e+0X1BggzI17wpNLe/RyuVsMjKUn0ApW1Dj5ZWUGf74=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DDK46qqBik12xjkqyBPM+ylXLxzvvr5ibcR+8hMGOGFCcydm0S/CKYeqVze9fan/vPWOmIAWuv+tykb8+nKai81kCeCOwGdTKwir4pAx1MJJq85C2Ua/0N7YarQBq1mQUct5XHRW4OR9Zm+iP9NQF3GCujXxBTVTSI9v6BihaSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=doI0a3x0; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=akmXuBPK reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="doI0a3x0"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="akmXuBPK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1736260763; x=1767796763; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J1yM4GW4YkH4sSr6aDIK6r6U62z1pZvrPK786Xfjgcc=; b=doI0a3x0pSRJj9JqnBlbxJgDJtnvb8vnm68n75PYUoc0kjivXrXRe3MK 7DCiYPA2uiSFWniRnAjRtLh64II0pO/Vbwe0DZfzndcGoujizVsSU1ynh TmiUX5qGAI6wxTHn1nluFHk8kWneca+90ZfNQI5KsTB90AKjPrPj/Ijtk /LCKBzhQOKyOEpb9ftN0l+cog61UCYQFcjtEzbwZxGnRggBFXLGrJl9IS Zf2x42rOAkzohW613vEsUM3RCt3XrPD568mHK0jRgtK7bNkXO8s7eL7fk 1KPqzjCazgyGLVAy6NMH2RdB0hceTQ4yX9vPvkSVSmDsVzEI9bgu3drv3 A==; X-CSE-ConnectionGUID: QyWCmoWdR92sY8SQ4BDnPQ== X-CSE-MsgGUID: d1obu0ihSym4Fk1pIal47Q== X-IronPort-AV: E=Sophos;i="6.12,295,1728943200"; d="scan'208";a="40897242" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 07 Jan 2025 15:39:21 +0100 X-CheckPoint: {677D3C99-4B-9B2B6168-EB6F31C5} X-MAIL-CPID: AF5E493BE366F514177D66585BB4F2B7_5 X-Control-Analysis: str=0001.0A682F20.677D3C9A.001E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A593A160B22; Tue, 7 Jan 2025 15:39:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1736260757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J1yM4GW4YkH4sSr6aDIK6r6U62z1pZvrPK786Xfjgcc=; b=akmXuBPKfC17Ejx73+QbFvd05OTCIsI5Dt+hgvY83nLqR4nzyp502jEuUCNexo9oc/i2Ro eq6T4ruk2tSVjGYgPC/Tm7Y2jbGe4yqfm9dYCdHMWjBO9tIfVEFjNWS0rB4kV/BCygFWE/ 1YTfIfmwx7aWVM/Sg40deUJLtk71JVSvue1EiO7rWpeqa3hp34cqcmJmuhBsm95g0keP3Z k2R7R34HKxMaNHDVIsUtjm1kE4UAI8zfTTfFaj57JI5HukXGkF1Yx01W0QWF8kEGO8l8z5 M8CUzn75n1WAm2zG17icnbnMRCQW8WFYcKTNVQcQeOvExjM7nZk/Rwm4mfUfTQ== 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 , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Alexander Stein , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] drm/bridge: imx8qxp-pxl2dpi: Use dev_err_probe Date: Tue, 7 Jan 2025 15:38:57 +0100 Message-Id: <20250107143900.988567-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> References: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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 65cf3a6c8ec69..038eaff889bb7 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -398,20 +398,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; @@ -422,13 +414,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 Tue Jan 7 14:38:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13929098 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA2E61F37A9 for ; Tue, 7 Jan 2025 14:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260773; cv=none; b=uhLnVP1pdMF+A2DkcNAo8NP5BTKHOlzWa0IM3NCacN8IGIHZVUfHxcaKZTWz81qtSKPKE/uhQ0VqizDHc8eJFI8VMQg2T6oqroBS8pWc+0/1blcu+nV6QpRMVM9AerVAYdX0eZNSfYneKCq2hVpok90QgT4zMpp3Apo1krdIY80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260773; c=relaxed/simple; bh=XWT2uhfUx7vF7rHsptlywIBKn4fnMYvdUd+pJhFZmww=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bTWUkYIGT0O/KM9ckdX/FkVPnHGf70oSpAn/QoLFlTIOYTrsfGLJeSTJUjnJ776geaUHQokHeJCeAW9PyLrdQiSSZWyLqbH31uFbBB8+NMG3vJZyzpsiqS3q9aA7joINlA4v5jNzLPETACdaoicxBoOEKb1x2I1HAyNS4XqEH50= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=ZhH2gjgG; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=Kz/TNRA2 reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="ZhH2gjgG"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="Kz/TNRA2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1736260770; x=1767796770; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v6ZalIwFfK9vUB0/HSTtySwzznHuXDMQLLMZDZH/dAc=; b=ZhH2gjgGQjG6YsFx31yKWMxec6hynBXay0dGhSCT7XgaCxqObbZmPwUs w/KY171Gs8NCgPznLHQA29u3IBQV0pkK9RFOJBqJ9TPYmzxbOdJ7zDY9G 7Vcc/3EYBmCl3K8Fwh1tkQrO1jqb5asG5vcEnFduqiGu1gUhQngInu/fq /LHe0QMWkIS3Jf2/z6kyA5salTtvuo+TuiORE6iGKGHI8PnaGPOP9Uu4K 1FHAJOP82CBmQCsw2AGKBTxNe4iPYHZ0jzfMdS6b/6eN7rBO3gGJ7BDJN 3QIO17Bt1w4JUpqWwgpnsZ1Q+pKlIuCvN/eh2qECUfhrVPrBXe+2yKXMt w==; X-CSE-ConnectionGUID: OLkKxxOYQ2O7L3x2p5kTEg== X-CSE-MsgGUID: kBmI3pPLQ6y9k7ktctXARQ== X-IronPort-AV: E=Sophos;i="6.12,295,1728943200"; d="scan'208";a="40897247" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 07 Jan 2025 15:39:27 +0100 X-CheckPoint: {677D3C9F-1F-3C670366-E45AD810} X-MAIL-CPID: 5D665BE28A4386F0867A29349A815CCC_4 X-Control-Analysis: str=0001.0A682F27.677D3C9F.00CA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 59956160B22; Tue, 7 Jan 2025 15:39:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1736260763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v6ZalIwFfK9vUB0/HSTtySwzznHuXDMQLLMZDZH/dAc=; b=Kz/TNRA2k3u0PyJ5oHB+nYGayQGkRTxZ/4I43G45iHR3By/K8jB9CNTC3ABHnqQ+5j4yi1 JK0iWidsvqz2r9mSf8ykklx9V5qMaTkR7iAxw2V8CPSar/qAY4r74lKL/noQSeVcC3VVOj je4FFLa5DIqPgszBZ3nBkUAmqXvJnXvKX30Y1XIgBDai1BUJ6zBIZ/BlC2qN9HwAzVqHmQ hNivDMYEMYc6BHoSSj8KRGOVdaMfOGRVTg8i89h8UNQBaLgqsi9GP1SeITDB3QCVktFNGH tENFAAGPUqz8kL4ALPtJ9jxdwF68cdWI7BZbASmcBCgXIL03jobcxGjHDJ+xOQ== 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 , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Alexander Stein , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] drm/bridge: imx8qxp-ldb: Use dev_err_probe Date: Tue, 7 Jan 2025 15:38:58 +0100 Message-Id: <20250107143900.988567-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> References: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein Reviewed-by: Liu Ying --- 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 7bce2305d6767..d5e123173f354 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 Tue Jan 7 14:38:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13929099 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0455D1F2371 for ; Tue, 7 Jan 2025 14:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260778; cv=none; b=g5hLFaJ80rju6P5wzA+ptTACCza6Cqx7ILpq2xkYfyB0lTzuK0sWis185AgCi/V+983OY6/cZrOUTePPikMahS+h/Fv0wc9LtkwKvvpPl6VaT7kCq8CcGbdi3ZOhuIk45Y3g/SD47YaGGgSS6dXvQxE5qrXwTxuD8NIq+JTxzHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260778; c=relaxed/simple; bh=/iNk5xHjFRCqBD6QAw52Fh9wUZngC7T+eM1bie/g0tU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=h1NHEXwEgc/KeyaC1E57ahhj5RyLcD3oVAFTXE8vyrL5eqr8kW6WOCljZSbRoa2nBuoozqOb6wu+GyINfH01Fv7+grQjWhaLkBBYks2mjguUuQ6NfIBI83I7rAPDobmYvBTcvq0WZvO/mDZz8G6wW4iuXCPRGp/pHx1aDn2tY18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=WBTSAxUR; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=EllWyCh9 reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="WBTSAxUR"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="EllWyCh9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1736260774; x=1767796774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XVzJm2W1uVdEFEZWkXxZ+spN7k+YpzBUagSYY5jbkr0=; b=WBTSAxUR9mNrGrB+BIXE05KLc1UrUR4nXpOfezQo/ygIPECuTJXORTi5 0sl8K38wfYq6X/QK/RISe43td7xKG++7PnM14jUDhv7mSnUQGc54JbXIH myuFffUwCYP5ZsYWzPrnPi3Lu8ouCnAc6IBfrZSNlYAo87vAFQKIIprZZ z2OajiDg1t5UAqz7gq+k60F0SaCEnHB/e5W6EPYWvLrZwUifF7LatIbUD xxuvBZZk6MvdvSEYE2pHpRZvjCqVLehwn2HO9ReHvkP6xrX++VDN3TCEX XYuyx/WCmrzgYsmgrmgjdcA7xgFTZm4s5yPnVjhg2IxRTET+uLCEotr9I A==; X-CSE-ConnectionGUID: jIb3ypKkSKyrja3ThHtuZg== X-CSE-MsgGUID: kaeze2RMQtO2pwYlPLFHvg== X-IronPort-AV: E=Sophos;i="6.12,295,1728943200"; d="scan'208";a="40897250" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 07 Jan 2025 15:39:33 +0100 X-CheckPoint: {677D3CA5-14-1D00F64B-E6C57517} X-MAIL-CPID: 800858C3296ADFDF66C2AAAF0E539E43_3 X-Control-Analysis: str=0001.0A682F15.677D3CA5.0092,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2D6A6160B22; Tue, 7 Jan 2025 15:39:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1736260769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XVzJm2W1uVdEFEZWkXxZ+spN7k+YpzBUagSYY5jbkr0=; b=EllWyCh9SvK4sD0noz8TqzYTsz87MPpHWGJx3iLQ+dsF4rFFUyeHuv1JxV6vKmssHezoYt vTdohZGKG3dXtwtlZPtTrrjWt5N4YboIORAs9Sua9hyqOX2tZrst+K+QI/46AENHPx5Pw0 LRUGxZsTI2SXuJAqQnIHZtgybEKhB7Kq5+b6bb5DkO5n0mwCI6BmGb88YONYQfvZFhN1gF sWAcDONNQjMJ5WIPpwnVFPPf/RGNKz9onpxeEdDQF5q52W9kMbfuCT0pEvHGP2KgKpCx/l kT08aoo4YIE8s/bk77hnylJcSUn4UaxoDyMs+6u/T44ThUXJk788xpTPUAhhuA== 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 , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Alexander Stein , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] drm/bridge: imx-ldb-helper: Use dev_err_probe Date: Tue, 7 Jan 2025 15:38:59 +0100 Message-Id: <20250107143900.988567-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> References: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein --- 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 9b5bebbe357dd..2c9b862af74af 100644 --- a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -167,7 +167,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]; @@ -177,14 +177,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 Tue Jan 7 14:39:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13929100 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7A421F3D24 for ; Tue, 7 Jan 2025 14:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260786; cv=none; b=sgFJ8H3dDZVpJJkWU9yhcheqaWLA2jFQJ884tgUN8vcRGmsZ0rLHV5DmhGoueYnciIx2GayP4npyp5QFTCDvv9TF0bNw6bzJW2qkNbskM2OIlyYMm26gHxRPjzHJUmLMxZILJnsGOkCSIrA6FCtxiJfsbFRa3UPq2HXFKelYuNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736260786; c=relaxed/simple; bh=AYotZSVHf9trc9nuQO+1cOi+4lUPYi0qGW5C8a7h0ro=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z+01tTwaZyINn/EUkeNwKKgz81bs81++7E0bYEZGddl3/5UXDptdPZdCGXz81A8wT8E/SVHedKt1FqjPTh6alldkYDDrdTVvrH48+fCtRPmTmd4i30dXR2UWOyVtI5OKOFiYJ4Wl2m52kOHMnMDnJe38kubXoFUHIZ8CdlmHiDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=gEOG+cXW; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=QS2VxVpT reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="gEOG+cXW"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="QS2VxVpT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1736260780; x=1767796780; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0iI7T0R6eCAxaxyKlzF/ND6AcM0EauPs1fZKfAI3pZM=; b=gEOG+cXWPNt+itM76HGpJWvgZWia6KbiaChICUwvjKPHUENrPC7Cq0M0 sVihrAEjRoSD+T1Ml2TiXz0Ov6qrkFPedMTjOw/n+n3enUPpYnEZOlkE4 5UssG+qffxvpHZaZkzHHkuUee0g+enUwcAVtAtm6QILFXAeQbGEEAc574 xiFH8EypcKsIRYoDLst6FNthMyjz222sexXQsp5TyEu2wVJHUKduNwm21 jEY5ID1c18Mo10pVSL+V3QfW70gLc2Fbm0DskIXaPo0yofxIYEPEqFlxM pVbBwxxlJfr5FwLO1hf3KMyKMk/kHjDBtpq5Ej50E6nZGmDiVQ3F7186u Q==; X-CSE-ConnectionGUID: odyyrwlQR9WlvSB13BRqAw== X-CSE-MsgGUID: PbEUURTTTSyZGDyba87qpA== X-IronPort-AV: E=Sophos;i="6.12,295,1728943200"; d="scan'208";a="40897254" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 07 Jan 2025 15:39:39 +0100 X-CheckPoint: {677D3CAB-12-31397509-E321C4C4} X-MAIL-CPID: 562AC94789849B901363AA16315BFA9E_0 X-Control-Analysis: str=0001.0A682F26.677D3CAB.0077,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D8806160B22; Tue, 7 Jan 2025 15:39:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1736260774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0iI7T0R6eCAxaxyKlzF/ND6AcM0EauPs1fZKfAI3pZM=; b=QS2VxVpTVdB1WaEfGv+GWDm26X5wPDOXJYAeb5LFd6sdrOCKvcrAsiQFkkTKTIwhf9Om84 cLyNjddXLlyONdDEl5jW2W3gtmgcTh+iQt+QArc0fEpAnPk2n3D3eNwjqMSTbwmoQa6trn TGdOicsp3Is0Mw5xurF9t1BUZn612LRJNc0RbM+67sIbLELBy+J78juLWh3IIWl/R285nm AuW4GY6vTWvxpSRdwXfO503WYUbC9rqoAGFBC+GWnG99fUgRpGSA+yFzW6ReazhvqJ6va1 r51N/cjz1WleLpweyKC/tYovISHm7yiCsq7fCQlu20hyvaobUqHl3cXibN/oTw== 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 , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Alexander Stein , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] drm/bridge: imx8qxp-pixel-link: Use dev_err_probe Date: Tue, 7 Jan 2025 15:39:00 +0100 Message-Id: <20250107143900.988567-5-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> References: <20250107143900.988567-1-alexander.stein@ew.tq-group.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 This simplifies the code and gives additional information upon deferral. Signed-off-by: Alexander Stein Reviewed-by: Liu Ying --- .../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 4b0715ed6f38c..6391038f3949f 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -333,12 +333,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) { @@ -374,13 +371,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);