public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: xusb: Use dev_err_probe() to simplify code
@ 2022-09-22  9:22 Yuan Can
  2022-09-24  7:05 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Yuan Can @ 2022-09-22  9:22 UTC (permalink / raw)
  To: jckuo, kishon, vkoul, thierry.reding, jonathanh, linux-phy,
	linux-tegra
  Cc: yuancan

In the probe path, dev_err() can be replaced with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name. It also sets the defer probe reason which can be
checked later through debugfs.

Signed-off-by: Yuan Can <yuancan@huawei.com>
---
 drivers/phy/tegra/xusb-tegra186.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index 5abdf81aa143..0996ede63387 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -1384,12 +1384,9 @@ tegra186_xusb_read_fuse_calibration(struct tegra186_xusb_padctl *padctl)
 		return -ENOMEM;
 
 	err = tegra_fuse_readl(TEGRA_FUSE_SKU_CALIB_0, &value);
-	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(dev, "failed to read calibration fuse: %d\n",
-				err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(dev, err,
+				     "failed to read calibration fuse\n");
 
 	dev_dbg(dev, "FUSE_USB_CALIB_0 %#x\n", value);
 
-- 
2.17.1


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

* Re: [PATCH] phy: tegra: xusb: Use dev_err_probe() to simplify code
  2022-09-22  9:22 [PATCH] phy: tegra: xusb: Use dev_err_probe() to simplify code Yuan Can
@ 2022-09-24  7:05 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-09-24  7:05 UTC (permalink / raw)
  To: Yuan Can; +Cc: jckuo, kishon, thierry.reding, jonathanh, linux-phy, linux-tegra

On 22-09-22, 09:22, Yuan Can wrote:
> In the probe path, dev_err() can be replaced with dev_err_probe()
> which will check if error code is -EPROBE_DEFER and prints the
> error name. It also sets the defer probe reason which can be
> checked later through debugfs.

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2022-09-24  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-22  9:22 [PATCH] phy: tegra: xusb: Use dev_err_probe() to simplify code Yuan Can
2022-09-24  7:05 ` Vinod Koul

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