Skip to contentSkip to conversation

Use dev_err_probe() to simplify code

PATCH In review Yuan Can 5 participants 20 messages Sep 22, 2022 – Sep 24, 2022

Subsystems (2)
lore
Share & tools
lore

Yuan Can

author
#0 lore raw

cover Use dev_err_probe() to simplify code

This series simplify the error handling in probe function by switching from dev_err() to dev_err_probe().

Yuan Can (7):
phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
phy: qcom-qusb2: Use dev_err_probe() to simplify code
phy: qcom-snps: Use dev_err_probe() to simplify code

 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     | 21 +++++----------
 .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c  |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c      |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c       |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qusb2.c         | 27 +++++++------------
 drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 +++++--------
 7 files changed, 34 insertions(+), 68 deletions(-)
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#1 lore raw

PATCH 1/7 phy: qcom-qmp-combo: 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/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +7 -14
index af608c4dc869..b215aaee588f 100644
@@ -2789,14 +2789,10 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
 	 */
 	qphy->pipe_clk = devm_get_clk_from_child(dev, np, NULL);
 	if (IS_ERR(qphy->pipe_clk)) {
-		if (cfg->type == PHY_TYPE_USB3) {
-			ret = PTR_ERR(qphy->pipe_clk);
-			if (ret != -EPROBE_DEFER)
-				dev_err(dev,
-					"failed to get lane%d pipe_clk, %d\n",
-					id, ret);
-			return ret;
-		}
+		if (cfg->type == PHY_TYPE_USB3)
+			return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk),
+					     "failed to get lane%d pipe_clk\n",
+					     id);
 		qphy->pipe_clk = NULL;
 	}
 
@@ -2913,12 +2909,9 @@ static int qcom_qmp_phy_combo_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qcom_qmp_phy_combo_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	num = of_get_available_child_count(dev->of_node);
 	/* do we have a rogue child node ? */
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] phy: qcom-qmp-combo: Use dev_err_probe() to simplify code

Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
  1 file changed, 7 insertions(+), 14 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#3 lore raw

PATCH 2/7 phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +3 -6
index a4ff15b289cd..8b58ad989397 100644
@@ -973,12 +973,9 @@ static int qcom_qmp_phy_pcie_msm8996_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qcom_qmp_phy_pcie_msm8996_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	num = of_get_available_child_count(dev->of_node);
 	/* do we have a rogue child node ? */
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 2/7
#4 lore raw

Re: [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code

Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#5 lore raw

PATCH 3/7 phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3 -6
index 2923977b205a..6bbfaeb23672 100644
@@ -2458,12 +2458,9 @@ static int qmp_pcie_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qmp_pcie_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	num = of_get_available_child_count(dev->of_node);
 	/* do we have a rogue child node ? */
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
reviewer Reviewed-by on v1 3/7
#6 lore raw

Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code

Quoted 20 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -2
index 2923977b205a..6bbfaeb23672 100644
@@ -2458,12 +2458,9 @@ static int qmp_pcie_probe(struct platform_device *pdev)
  		return ret;
 
  	ret = qmp_pcie_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static int qmp_pcie_probe(struct platform_device *pdev) · line 2466

Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3 -4
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
  	num = of_get_available_child_count(dev->of_node);
  	/* do we have a rogue child node ? */
Reviewed-by on v1 3/7
#7 lore raw

Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code

In reply to Yuan Can
Quoted 6 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.

Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#8 lore raw

PATCH 4/7 phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +3 -6
index 01a99a06fd4f..198353e8ca81 100644
@@ -1316,12 +1316,9 @@ static int qcom_qmp_phy_ufs_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qcom_qmp_phy_ufs_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	num = of_get_available_child_count(dev->of_node);
 	/* do we have a rogue child node ? */
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 4/7
#9 lore raw

Re: [PATCH 4/7] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code

Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#10 lore raw

PATCH 5/7 phy: qcom-qmp-usb: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +3 -6
index fba8e40441cb..41f91829af17 100644
@@ -2821,12 +2821,9 @@ static int qcom_qmp_phy_usb_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = qcom_qmp_phy_usb_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	num = of_get_available_child_count(dev->of_node);
 	/* do we have a rogue child node ? */
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
reviewer Reviewed-by on v1 5/7
#11 lore raw

Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code

Quoted 20 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0 -2
index fba8e40441cb..41f91829af17 100644
@@ -2821,12 +2821,9 @@ static int qcom_qmp_phy_usb_probe(struct platform_device *pdev)
  		return ret;
 
  	ret = qcom_qmp_phy_usb_vreg_init(dev, cfg);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)

drivers/phy/qualcomm/phy-qcom-qmp-usb.c static int qcom_qmp_phy_usb_probe(struct platform_device *pdev) · line 2829

Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +3 -4
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
  	num = of_get_available_child_count(dev->of_node);
  	/* do we have a rogue child node ? */
Reviewed-by on v1 5/7
#12 lore raw

Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code

In reply to Yuan Can
Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#13 lore raw

PATCH 6/7 phy: qcom-qusb2: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/phy/qualcomm/phy-qcom-qusb2.c +9 -18
index 7529a7e6e5df..2ef638b32e8f 100644
@@ -973,20 +973,14 @@ static int qusb2_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(qphy->base);
 
 	qphy->cfg_ahb_clk = devm_clk_get(dev, "cfg_ahb");
-	if (IS_ERR(qphy->cfg_ahb_clk)) {
-		ret = PTR_ERR(qphy->cfg_ahb_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get cfg ahb clk, %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(qphy->cfg_ahb_clk))
+		return dev_err_probe(dev, PTR_ERR(qphy->cfg_ahb_clk),
+				     "failed to get cfg ahb clk\n");
 
 	qphy->ref_clk = devm_clk_get(dev, "ref");
-	if (IS_ERR(qphy->ref_clk)) {
-		ret = PTR_ERR(qphy->ref_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get ref clk, %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(qphy->ref_clk))
+		return dev_err_probe(dev, PTR_ERR(qphy->ref_clk),
+				     "failed to get ref clk\n");
 
 	qphy->iface_clk = devm_clk_get_optional(dev, "iface");
 	if (IS_ERR(qphy->iface_clk))
@@ -1003,12 +997,9 @@ static int qusb2_phy_probe(struct platform_device *pdev)
 		qphy->vregs[i].supply = qusb2_phy_vreg_names[i];
 
 	ret = devm_regulator_bulk_get(dev, num, qphy->vregs);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	/* Get the specific init parameters of QMP phy */
 	qphy->cfg = of_device_get_match_data(dev);
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
reviewer Reviewed-by on v1 6/7
#14 lore raw

Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code

Quoted 47 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.

---
  drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
  1 file changed, 9 insertions(+), 18 deletions(-)
drivers/phy/qualcomm/phy-qcom-qusb2.c +6 -14
index 7529a7e6e5df..2ef638b32e8f 100644
@@ -973,20 +973,14 @@ static int qusb2_phy_probe(struct platform_device *pdev)
  		return PTR_ERR(qphy->base);
 
  	qphy->cfg_ahb_clk = devm_clk_get(dev, "cfg_ahb");
-	if (IS_ERR(qphy->cfg_ahb_clk)) {
-		ret = PTR_ERR(qphy->cfg_ahb_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get cfg ahb clk, %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(qphy->cfg_ahb_clk))
+		return dev_err_probe(dev, PTR_ERR(qphy->cfg_ahb_clk),
+				     "failed to get cfg ahb clk\n");
 
  	qphy->ref_clk = devm_clk_get(dev, "ref");
-	if (IS_ERR(qphy->ref_clk)) {
-		ret = PTR_ERR(qphy->ref_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get ref clk, %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(qphy->ref_clk))
+		return dev_err_probe(dev, PTR_ERR(qphy->ref_clk),
+				     "failed to get ref clk\n");
 
  	qphy->iface_clk = devm_clk_get_optional(dev, "iface");
  	if (IS_ERR(qphy->iface_clk))
@@ -1003,12 +997,9 @@ static int qusb2_phy_probe(struct platform_device *pdev)
  		qphy->vregs[i].supply = qusb2_phy_vreg_names[i];
 
  	ret = devm_regulator_bulk_get(dev, num, qphy->vregs);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)

drivers/phy/qualcomm/phy-qcom-qusb2.c static int qusb2_phy_probe(struct platform_device *pdev) · line 1005

Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qusb2.c +3 -4
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
  	/* Get the specific init parameters of QMP phy */
  	qphy->cfg = of_device_get_match_data(dev);

The error handling of devm_reset_control_get_by_index() could probably be replaced with dev_err_probe() aswell.

Anyway:

Reviewed-by on v1 6/7
#15 lore raw

Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code

In reply to Yuan Can
Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
  1 file changed, 9 insertions(+), 18 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#16 lore raw

PATCH 7/7 phy: qcom-snps: Use dev_err_probe() to simplify code

In reply to 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.

---
 drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +6 -12
index 25022949108b..a59063596214 100644
@@ -559,12 +559,9 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev)
 		return PTR_ERR(hsphy->base);
 
 	hsphy->ref_clk = devm_clk_get(dev, "ref");
-	if (IS_ERR(hsphy->ref_clk)) {
-		ret = PTR_ERR(hsphy->ref_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get ref clk, %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(hsphy->ref_clk))
+		return dev_err_probe(dev, PTR_ERR(hsphy->ref_clk),
+				     "failed to get ref clk\n");
 
 	hsphy->phy_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
 	if (IS_ERR(hsphy->phy_reset)) {
@@ -577,12 +574,9 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev)
 		hsphy->vregs[i].supply = qcom_snps_hsphy_vreg_names[i];
 
 	ret = devm_regulator_bulk_get(dev, num, hsphy->vregs);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get regulator supplies: %d\n",
-				ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to get regulator supplies\n");
 
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
Signature · 7 lines
2.17.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 7/7
#17 lore raw

Re: [PATCH 7/7] phy: qcom-snps: Use dev_err_probe() to simplify code

Quoted 9 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.

---
  drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
  1 file changed, 6 insertions(+), 12 deletions(-)
Signature · 8 lines
With best wishes
Dmitry


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on the v1 series
#18 lore raw
In reply to Yuan Can
Quoted 12 lines · Yuan Can

This series simplify the error handling in probe function by switching from dev_err() to dev_err_probe().

Yuan Can (7):
phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
phy: qcom-qusb2: Use dev_err_probe() to simplify code
phy: qcom-snps: Use dev_err_probe() to simplify code

Quoted 12 lines
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     | 21 +++++----------
 .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c  |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c      |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c       |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       |  9 +++----
 drivers/phy/qualcomm/phy-qcom-qusb2.c         | 27 +++++++------------
 drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 +++++--------
 7 files changed, 34 insertions(+), 68 deletions(-)
Signature · 1 line
2.17.1

The whole series looks good to me:

maintainer
#19 lore raw
In reply to Yuan Can
Quoted 11 lines · Yuan Can

This series simplify the error handling in probe function by switching from dev_err() to dev_err_probe().

Yuan Can (7):
phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
phy: qcom-qusb2: Use dev_err_probe() to simplify code
phy: qcom-snps: Use dev_err_probe() to simplify code

phy: qcom-snps: Use dev_err_probe() to simplify code
phy: qcom-qusb2: Use dev_err_probe() to simplify code
phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code

Applied these three, rest have conflicts please rebase and resend with acks collected

Signature · 1 line
~Vinod