diff mbox series

[3/6] drm/bridge: imx: imx-ldb-helper: Use dev_err_probe

Message ID 20231218105718.2445136-4-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series dev_err_probe usage for imx8qxp DPU pipeline | expand

Commit Message

Alexander Stein Dec. 18, 2023, 10:57 a.m. UTC
This simplifies the code and gives additional information upon deferral.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/gpu/drm/bridge/imx/imx-ldb-helper.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Francesco Dolcini Jan. 4, 2024, 7:20 p.m. UTC | #1
On Mon, Dec 18, 2023 at 11:57:15AM +0100, Alexander Stein wrote:
> This simplifies the code and gives additional information upon deferral.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Francesco Dolcini Jan. 4, 2024, 7:28 p.m. UTC | #2
On Thu, Jan 04, 2024 at 08:20:37PM +0100, Francesco Dolcini wrote:
> On Mon, Dec 18, 2023 at 11:57:15AM +0100, Alexander Stein wrote:
> > This simplifies the code and gives additional information upon deferral.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>

mumble, looking at this more closely with your change you stop using
the print wrapper from drm_print.h. Probably a more generic solution is
needed there?

Francesco
Alexander Stein Jan. 8, 2024, 9:36 a.m. UTC | #3
Hi Francesco,

thanks for the feedback.

Am Donnerstag, 4. Januar 2024, 20:28:08 CET schrieb Francesco Dolcini:
> On Thu, Jan 04, 2024 at 08:20:37PM +0100, Francesco Dolcini wrote:
> > On Mon, Dec 18, 2023 at 11:57:15AM +0100, Alexander Stein wrote:
> > > This simplifies the code and gives additional information upon deferral.
> > > 
> > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > 
> > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> mumble, looking at this more closely with your change you stop using
> the print wrapper from drm_print.h. Probably a more generic solution is
> needed there?

You are talking about DRM_DEV_ERROR()? Well, it's deprecated, see [1]. Instead 
of dev_err, I rather use dev_err_probe because this is what we want to use 
here.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/
include/drm/drm_print.h#n365
diff mbox series

Patch

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;