All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe()
@ 2021-09-17  2:07 Cai Huoqing
  2023-04-04 12:14   ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Cai Huoqing @ 2021-09-17  2:07 UTC (permalink / raw)
  To: caihuoqing
  Cc: Thierry Reding, David Airlie, Daniel Vetter, Jonathan Hunter,
	dri-devel, linux-tegra, linux-kernel

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
v1->v2: Fix compile error-add ';'

 drivers/gpu/drm/tegra/sor.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 0ea320c1092b..d7964e498da9 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -2964,11 +2964,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	int err;
 
 	sor->avdd_io_supply = devm_regulator_get(sor->dev, "avdd-io-hdmi-dp");
-	if (IS_ERR(sor->avdd_io_supply)) {
-		dev_err(sor->dev, "cannot get AVDD I/O supply: %ld\n",
-			PTR_ERR(sor->avdd_io_supply));
-		return PTR_ERR(sor->avdd_io_supply);
-	}
+	if (IS_ERR(sor->avdd_io_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->avdd_io_supply),
+				     "cannot get AVDD I/O supply\n");
 
 	err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply);
 	if (err < 0) {
@@ -2978,11 +2976,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	}
 
 	sor->vdd_pll_supply = devm_regulator_get(sor->dev, "vdd-hdmi-dp-pll");
-	if (IS_ERR(sor->vdd_pll_supply)) {
-		dev_err(sor->dev, "cannot get VDD PLL supply: %ld\n",
-			PTR_ERR(sor->vdd_pll_supply));
-		return PTR_ERR(sor->vdd_pll_supply);
-	}
+	if (IS_ERR(sor->vdd_pll_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->vdd_pll_supply),
+				     "cannot get VDD PLL supply\n");
 
 	err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply);
 	if (err < 0) {
@@ -2992,11 +2988,9 @@ static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	}
 
 	sor->hdmi_supply = devm_regulator_get(sor->dev, "hdmi");
-	if (IS_ERR(sor->hdmi_supply)) {
-		dev_err(sor->dev, "cannot get HDMI supply: %ld\n",
-			PTR_ERR(sor->hdmi_supply));
-		return PTR_ERR(sor->hdmi_supply);
-	}
+	if (IS_ERR(sor->hdmi_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->hdmi_supply),
+				     "cannot get HDMI supply\n");
 
 	err = tegra_sor_enable_regulator(sor, sor->hdmi_supply);
 	if (err < 0) {
-- 
2.25.1


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

* Re: [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe()
  2021-09-17  2:07 [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe() Cai Huoqing
@ 2023-04-04 12:14   ` Thierry Reding
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2023-04-04 12:14 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: David Airlie, linux-kernel, dri-devel, Jonathan Hunter,
	Thierry Reding, linux-tegra

From: Thierry Reding <treding@nvidia.com>

On Fri, 17 Sep 2021 10:07:41 +0800, Cai Huoqing wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> And using dev_err_probe() can reduce code size, the error value
> gets printed.
> 
> 
> [...]

Applied, thanks!

[1/1] drm/tegra: sor: Make use of the helper function dev_err_probe()
      commit: a4c56f2f8ce0e242eb51e5309a743361e2348a64

Best regards,
-- 
Thierry Reding <treding@nvidia.com>

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

* Re: [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe()
@ 2023-04-04 12:14   ` Thierry Reding
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2023-04-04 12:14 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Daniel Vetter, Thierry Reding, Jonathan Hunter, linux-tegra,
	dri-devel, David Airlie, linux-kernel

From: Thierry Reding <treding@nvidia.com>

On Fri, 17 Sep 2021 10:07:41 +0800, Cai Huoqing wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> And using dev_err_probe() can reduce code size, the error value
> gets printed.
> 
> 
> [...]

Applied, thanks!

[1/1] drm/tegra: sor: Make use of the helper function dev_err_probe()
      commit: a4c56f2f8ce0e242eb51e5309a743361e2348a64

Best regards,
-- 
Thierry Reding <treding@nvidia.com>

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

end of thread, other threads:[~2023-04-04 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17  2:07 [PATCH v2] drm/tegra: sor: Make use of the helper function dev_err_probe() Cai Huoqing
2023-04-04 12:14 ` Thierry Reding
2023-04-04 12:14   ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.