Skip to contentSkip to conversation

phy: tegra: xusb: Use dev_err_probe() to simplify code

PATCH Applied Yuan Can 2 participants 2 messages Sep 22, 2022 – Sep 24, 2022

Subsystems (3)
lore
Share & tools
lore

Yuan Can

author
#0 lore raw

PATCH 1/1 phy: tegra: xusb: Use dev_err_probe() to simplify code

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.

---
 drivers/phy/tegra/xusb-tegra186.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/tegra/xusb-tegra186.c +3 -6
index 5abdf81aa143..0996ede63387 100644
@@ -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);
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Yuan Can

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

Signature · 6 lines
~Vinod

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy