Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] gpu: host1x: use dev_err_probe() in probe path
@ 2025-07-28  0:15 Akhilesh Patil
  2025-08-22  3:18 ` Mikko Perttunen
  2025-08-22  6:14 ` [PATCH v2] " Akhilesh Patil
  0 siblings, 2 replies; 5+ messages in thread
From: Akhilesh Patil @ 2025-07-28  0:15 UTC (permalink / raw)
  To: thierry.reding, mperttunen, airlied, simona
  Cc: dri-devel, linux-tegra, linux-kernel, akhileshpatilvnit, skhan

Use dev_err_probe() helper as recommended by core driver model in
drivers/base/core.c to handle deferred probe error. Improve code
consistency and debuggability using standard helper.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
 drivers/gpu/host1x/dev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 1f93e5e276c0..e6f3cbeb9ae5 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -587,11 +587,7 @@ static int host1x_probe(struct platform_device *pdev)
 	host->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(host->clk)) {
 		err = PTR_ERR(host->clk);
-
-		if (err != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get clock: %d\n", err);
-
-		return err;
+		return dev_err_probe(&pdev->dev, err, "failed to get clock: %d\n", err);
 	}
 
 	err = host1x_get_resets(host);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpu: host1x: use dev_err_probe() in probe path
  2025-07-28  0:15 [PATCH] gpu: host1x: use dev_err_probe() in probe path Akhilesh Patil
@ 2025-08-22  3:18 ` Mikko Perttunen
  2025-08-22  6:00   ` Akhilesh Patil
  2025-08-22  6:14 ` [PATCH v2] " Akhilesh Patil
  1 sibling, 1 reply; 5+ messages in thread
From: Mikko Perttunen @ 2025-08-22  3:18 UTC (permalink / raw)
  To: thierry.reding, airlied, simona, Akhilesh Patil
  Cc: dri-devel, linux-tegra, linux-kernel, akhileshpatilvnit, skhan

On Monday, July 28, 2025 9:15 AM Akhilesh Patil wrote:
> Use dev_err_probe() helper as recommended by core driver model in
> drivers/base/core.c to handle deferred probe error. Improve code
> consistency and debuggability using standard helper.
> 
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> ---
>  drivers/gpu/host1x/dev.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 1f93e5e276c0..e6f3cbeb9ae5 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -587,11 +587,7 @@ static int host1x_probe(struct platform_device *pdev)
>  	host->clk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(host->clk)) {
>  		err = PTR_ERR(host->clk);
> -
> -		if (err != -EPROBE_DEFER)
> -			dev_err(&pdev->dev, "failed to get clock: %d\n", 
err);
> -
> -		return err;
> +		return dev_err_probe(&pdev->dev, err, "failed to get clock: 
%d\n", err);

AIUI, dev_err_probe already prints err, so we don't need to repeat it in the 
message. With that, PTR_ERR(host->clk) can also be inlined into the 
dev_err_probe call.

Cheers,
Mikko

>  	}
> 
>  	err = host1x_get_resets(host);





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gpu: host1x: use dev_err_probe() in probe path
  2025-08-22  3:18 ` Mikko Perttunen
@ 2025-08-22  6:00   ` Akhilesh Patil
  0 siblings, 0 replies; 5+ messages in thread
From: Akhilesh Patil @ 2025-08-22  6:00 UTC (permalink / raw)
  To: Mikko Perttunen
  Cc: thierry.reding, airlied, simona, dri-devel, linux-tegra,
	linux-kernel, akhileshpatilvnit, skhan

On Fri, Aug 22, 2025 at 12:18:38PM +0900, Mikko Perttunen wrote:
> On Monday, July 28, 2025 9:15 AM Akhilesh Patil wrote:
> > Use dev_err_probe() helper as recommended by core driver model in
> > drivers/base/core.c to handle deferred probe error. Improve code
> > consistency and debuggability using standard helper.
> > 
> > Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> > ---
> >  drivers/gpu/host1x/dev.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > index 1f93e5e276c0..e6f3cbeb9ae5 100644
> > --- a/drivers/gpu/host1x/dev.c
> > +++ b/drivers/gpu/host1x/dev.c
> > @@ -587,11 +587,7 @@ static int host1x_probe(struct platform_device *pdev)
> >  	host->clk = devm_clk_get(&pdev->dev, NULL);
> >  	if (IS_ERR(host->clk)) {
> >  		err = PTR_ERR(host->clk);
> > -
> > -		if (err != -EPROBE_DEFER)
> > -			dev_err(&pdev->dev, "failed to get clock: %d\n", 
> err);
> > -
> > -		return err;
> > +		return dev_err_probe(&pdev->dev, err, "failed to get clock: 
> %d\n", err);
> 
> AIUI, dev_err_probe already prints err, so we don't need to repeat it in the 
> message. With that, PTR_ERR(host->clk) can also be inlined into the 
> dev_err_probe call.
ACK. Thanks for the review.
Posted v2 addressing this with 6.17-rc2 rebased build tested.

Regards,
Akhilesh
> 
> Cheers,
> Mikko
> 
> >  	}
> > 
> >  	err = host1x_get_resets(host);
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] gpu: host1x: use dev_err_probe() in probe path
  2025-07-28  0:15 [PATCH] gpu: host1x: use dev_err_probe() in probe path Akhilesh Patil
  2025-08-22  3:18 ` Mikko Perttunen
@ 2025-08-22  6:14 ` Akhilesh Patil
  2025-08-26  6:30   ` Mikko Perttunen
  1 sibling, 1 reply; 5+ messages in thread
From: Akhilesh Patil @ 2025-08-22  6:14 UTC (permalink / raw)
  To: thierry.reding, mperttunen, airlied, simona
  Cc: dri-devel, linux-tegra, linux-kernel, akhileshpatilvnit, skhan

Use dev_err_probe() helper as recommended by core driver model in
drivers/base/core.c to handle deferred probe error. Improve code
consistency and debuggability using standard helper.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
V1 -> V2: addressed review comments as below.
* inline - err = PTR_ERR(host->clk) inside dev_err_probe()
* avoid printing err, as dev_err_probe() prints it internally.
* rebase and compile test with v6.17-rc2

 drivers/gpu/host1x/dev.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 1f93e5e276c0..c586c242f2c2 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -585,14 +585,8 @@ static int host1x_probe(struct platform_device *pdev)
 	}
 
 	host->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(host->clk)) {
-		err = PTR_ERR(host->clk);
-
-		if (err != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get clock: %d\n", err);
-
-		return err;
-	}
+	if (IS_ERR(host->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(host->clk), "failed to get clock\n");
 
 	err = host1x_get_resets(host);
 	if (err)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] gpu: host1x: use dev_err_probe() in probe path
  2025-08-22  6:14 ` [PATCH v2] " Akhilesh Patil
@ 2025-08-26  6:30   ` Mikko Perttunen
  0 siblings, 0 replies; 5+ messages in thread
From: Mikko Perttunen @ 2025-08-26  6:30 UTC (permalink / raw)
  To: thierry.reding, airlied, simona, Akhilesh Patil
  Cc: dri-devel, linux-tegra, linux-kernel, akhileshpatilvnit, skhan

On Friday, August 22, 2025 3:14 PM Akhilesh Patil wrote:
> Use dev_err_probe() helper as recommended by core driver model in
> drivers/base/core.c to handle deferred probe error. Improve code
> consistency and debuggability using standard helper.
> 
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> ---
> V1 -> V2: addressed review comments as below.
> * inline - err = PTR_ERR(host->clk) inside dev_err_probe()
> * avoid printing err, as dev_err_probe() prints it internally.
> * rebase and compile test with v6.17-rc2
> 
>  drivers/gpu/host1x/dev.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 1f93e5e276c0..c586c242f2c2 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -585,14 +585,8 @@ static int host1x_probe(struct platform_device *pdev)
>  	}
> 
>  	host->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(host->clk)) {
> -		err = PTR_ERR(host->clk);
> -
> -		if (err != -EPROBE_DEFER)
> -			dev_err(&pdev->dev, "failed to get clock: %d\n", 
err);
> -
> -		return err;
> -	}
> +	if (IS_ERR(host->clk))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(host->clk), "failed 
to get
> clock\n");
> 
>  	err = host1x_get_resets(host);
>  	if (err)

Thanks!

Tested-by: Mikko Perttunen <mperttunen@nvidia.com>
Acked-by: Mikko Perttunen <mperttunen@nvidia.com>





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-26  6:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28  0:15 [PATCH] gpu: host1x: use dev_err_probe() in probe path Akhilesh Patil
2025-08-22  3:18 ` Mikko Perttunen
2025-08-22  6:00   ` Akhilesh Patil
2025-08-22  6:14 ` [PATCH v2] " Akhilesh Patil
2025-08-26  6:30   ` Mikko Perttunen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox