mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next 0/2] Use dev_err_probe() in gpu
@ 2025-04-02 11:36 shao.mingyin
  2025-04-02 11:37 ` [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe() shao.mingyin
  2025-04-02 11:38 ` [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: " shao.mingyin
  0 siblings, 2 replies; 6+ messages in thread
From: shao.mingyin @ 2025-04-02 11:36 UTC (permalink / raw)
  To: thierry.reding, laurent.pinchart
  Cc: mperttunen, airlied, simona, jonathanh, dri-devel, linux-tegra,
	linux-kernel, laurent.pinchart, tomi.valkeinen,
	maarten.lankhorst, mripard, tzimmermann, michal.simek,
	linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
	zhang.enpei

From: Zhang Enpei <zhang.enpei@zte.com.cn>

Use dev_err_probe() to simplify the following code
sequence:
  if (err != -EPROBE_DEFER)
      dev_err(dev, ...);
  else
      dev_dbg(dev, ...);
  return err;

Zhang Enpei (2):
  gpu: drm: tegra: dpaux: Use dev_err_probe()
  gpu: drm: xlnx: zynqmp_dp: Use dev_err_probe()

 drivers/gpu/drm/tegra/dpaux.c    | 11 +++--------
 drivers/gpu/drm/xlnx/zynqmp_dp.c |  6 ++----
 2 files changed, 5 insertions(+), 12 deletions(-)

-- 
2.25.1

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

* [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe()
  2025-04-02 11:36 [PATCH linux-next 0/2] Use dev_err_probe() in gpu shao.mingyin
@ 2025-04-02 11:37 ` shao.mingyin
  2025-05-07 15:44   ` Thierry Reding
  2025-04-02 11:38 ` [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: " shao.mingyin
  1 sibling, 1 reply; 6+ messages in thread
From: shao.mingyin @ 2025-04-02 11:37 UTC (permalink / raw)
  To: thierry.reding, laurent.pinchart
  Cc: mperttunen, airlied, simona, jonathanh, dri-devel, linux-tegra,
	linux-kernel, tomi.valkeinen, maarten.lankhorst, mripard,
	tzimmermann, michal.simek, linux-arm-kernel, yang.yang29,
	xu.xin16, ye.xingchen, zhang.enpei

From: Zhang Enpei <zhang.enpei@zte.com.cn>

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/gpu/drm/tegra/dpaux.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
index 2cd8dcb959c0..e5297ac5c0fc 100644
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -501,14 +501,9 @@ static int tegra_dpaux_probe(struct platform_device *pdev)

 	dpaux->vdd = devm_regulator_get_optional(&pdev->dev, "vdd");
 	if (IS_ERR(dpaux->vdd)) {
-		if (PTR_ERR(dpaux->vdd) != -ENODEV) {
-			if (PTR_ERR(dpaux->vdd) != -EPROBE_DEFER)
-				dev_err(&pdev->dev,
-					"failed to get VDD supply: %ld\n",
-					PTR_ERR(dpaux->vdd));
-
-			return PTR_ERR(dpaux->vdd);
-		}
+		if (PTR_ERR(dpaux->vdd) != -ENODEV)
+			return dev_err_probe(&pdev->dev, PTR_ERR(dpaux->vdd),
+					     "failed to get VDD supply\n");

 		dpaux->vdd = NULL;
 	}
-- 
2.25.1

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

* [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: Use dev_err_probe()
  2025-04-02 11:36 [PATCH linux-next 0/2] Use dev_err_probe() in gpu shao.mingyin
  2025-04-02 11:37 ` [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe() shao.mingyin
@ 2025-04-02 11:38 ` shao.mingyin
  2025-04-02 12:49   ` Laurent Pinchart
  2025-04-16 11:42   ` Tomi Valkeinen
  1 sibling, 2 replies; 6+ messages in thread
From: shao.mingyin @ 2025-04-02 11:38 UTC (permalink / raw)
  To: thierry.reding, laurent.pinchart
  Cc: mperttunen, airlied, simona, jonathanh, dri-devel, linux-tegra,
	linux-kernel, tomi.valkeinen, maarten.lankhorst, mripard,
	tzimmermann, michal.simek, linux-arm-kernel, yang.yang29,
	xu.xin16, ye.xingchen, zhang.enpei

From: Zhang Enpei <zhang.enpei@zte.com.cn>

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index a6a4a871f197..28efa4c7ec8e 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -2466,10 +2466,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)

 	dp->reset = devm_reset_control_get(dp->dev, NULL);
 	if (IS_ERR(dp->reset)) {
-		if (PTR_ERR(dp->reset) != -EPROBE_DEFER)
-			dev_err(dp->dev, "failed to get reset: %ld\n",
-				PTR_ERR(dp->reset));
-		ret = PTR_ERR(dp->reset);
+		ret = dev_err_probe(dp->dev, PTR_ERR(dp->reset),
+				    "failed to get reset\n");
 		goto err_free;
 	}

-- 
2.25.1

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

* Re: [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: Use dev_err_probe()
  2025-04-02 11:38 ` [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: " shao.mingyin
@ 2025-04-02 12:49   ` Laurent Pinchart
  2025-04-16 11:42   ` Tomi Valkeinen
  1 sibling, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2025-04-02 12:49 UTC (permalink / raw)
  To: shao.mingyin
  Cc: thierry.reding, mperttunen, airlied, simona, jonathanh,
	dri-devel, linux-tegra, linux-kernel, tomi.valkeinen,
	maarten.lankhorst, mripard, tzimmermann, michal.simek,
	linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
	zhang.enpei

On Wed, Apr 02, 2025 at 07:38:52PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/xlnx/zynqmp_dp.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> index a6a4a871f197..28efa4c7ec8e 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> @@ -2466,10 +2466,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)
> 
>  	dp->reset = devm_reset_control_get(dp->dev, NULL);
>  	if (IS_ERR(dp->reset)) {
> -		if (PTR_ERR(dp->reset) != -EPROBE_DEFER)
> -			dev_err(dp->dev, "failed to get reset: %ld\n",
> -				PTR_ERR(dp->reset));
> -		ret = PTR_ERR(dp->reset);
> +		ret = dev_err_probe(dp->dev, PTR_ERR(dp->reset),
> +				    "failed to get reset\n");
>  		goto err_free;
>  	}
> 

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: Use dev_err_probe()
  2025-04-02 11:38 ` [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: " shao.mingyin
  2025-04-02 12:49   ` Laurent Pinchart
@ 2025-04-16 11:42   ` Tomi Valkeinen
  1 sibling, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2025-04-16 11:42 UTC (permalink / raw)
  To: shao.mingyin, thierry.reding, laurent.pinchart
  Cc: mperttunen, airlied, simona, jonathanh, dri-devel, linux-tegra,
	linux-kernel, maarten.lankhorst, mripard, tzimmermann,
	michal.simek, linux-arm-kernel, yang.yang29, xu.xin16,
	ye.xingchen, zhang.enpei, Sagar, Vishal

Hi,

On 02/04/2025 14:38, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
>   drivers/gpu/drm/xlnx/zynqmp_dp.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> index a6a4a871f197..28efa4c7ec8e 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> @@ -2466,10 +2466,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)
> 
>   	dp->reset = devm_reset_control_get(dp->dev, NULL);
>   	if (IS_ERR(dp->reset)) {
> -		if (PTR_ERR(dp->reset) != -EPROBE_DEFER)
> -			dev_err(dp->dev, "failed to get reset: %ld\n",
> -				PTR_ERR(dp->reset));
> -		ret = PTR_ERR(dp->reset);
> +		ret = dev_err_probe(dp->dev, PTR_ERR(dp->reset),
> +				    "failed to get reset\n");
>   		goto err_free;
>   	}
> 

Thanks. I can pick this up via drm-misc.

  Tomi


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

* Re: [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe()
  2025-04-02 11:37 ` [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe() shao.mingyin
@ 2025-05-07 15:44   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2025-05-07 15:44 UTC (permalink / raw)
  To: shao.mingyin
  Cc: laurent.pinchart, mperttunen, airlied, simona, jonathanh,
	dri-devel, linux-tegra, linux-kernel, tomi.valkeinen,
	maarten.lankhorst, mripard, tzimmermann, michal.simek,
	linux-arm-kernel, yang.yang29, xu.xin16, ye.xingchen,
	zhang.enpei

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Wed, Apr 02, 2025 at 07:37:58PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
>  drivers/gpu/drm/tegra/dpaux.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2025-05-07 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-02 11:36 [PATCH linux-next 0/2] Use dev_err_probe() in gpu shao.mingyin
2025-04-02 11:37 ` [PATCH linux-next 1/2] gpu: drm: tegra: dpaux: Use dev_err_probe() shao.mingyin
2025-05-07 15:44   ` Thierry Reding
2025-04-02 11:38 ` [PATCH linux-next 2/2] gpu: drm: xlnx: zynqmp_dp: " shao.mingyin
2025-04-02 12:49   ` Laurent Pinchart
2025-04-16 11:42   ` Tomi Valkeinen

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

all inboxes | Powered by JetHome®