All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Use dev_err_probe() to simplify code
@ 2022-09-22 11:12 ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  Cc: yuancan

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(-)

-- 
2.17.1


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

* [PATCH 0/7] Use dev_err_probe() to simplify code
@ 2022-09-22 11:12 ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  Cc: yuancan

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(-)

-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 1/7] phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index af608c4dc869..b215aaee588f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -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 ? */
-- 
2.17.1


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

* [PATCH 1/7] phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index af608c4dc869..b215aaee588f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -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 ? */
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
index a4ff15b289cd..8b58ad989397 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
@@ -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 ? */
-- 
2.17.1


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

* [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
index a4ff15b289cd..8b58ad989397 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
@@ -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 ? */
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index 2923977b205a..6bbfaeb23672 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -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 ? */
-- 
2.17.1


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

* [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index 2923977b205a..6bbfaeb23672 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -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 ? */
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 4/7] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
index 01a99a06fd4f..198353e8ca81 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
@@ -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 ? */
-- 
2.17.1


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

* [PATCH 4/7] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
index 01a99a06fd4f..198353e8ca81 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
@@ -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 ? */
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index fba8e40441cb..41f91829af17 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -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 ? */
-- 
2.17.1


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

* [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index fba8e40441cb..41f91829af17 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -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 ? */
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
index 7529a7e6e5df..2ef638b32e8f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
@@ -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);
-- 
2.17.1


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

* [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
index 7529a7e6e5df..2ef638b32e8f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
@@ -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);
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 7/7] phy: qcom-snps: Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 11:12   ` Yuan Can
  -1 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
index 25022949108b..a59063596214 100644
--- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
+++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
@@ -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);
-- 
2.17.1


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

* [PATCH 7/7] phy: qcom-snps: Use dev_err_probe() to simplify code
@ 2022-09-22 11:12   ` Yuan Can
  0 siblings, 0 replies; 40+ messages in thread
From: Yuan Can @ 2022-09-22 11:12 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy
  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/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
index 25022949108b..a59063596214 100644
--- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
+++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
@@ -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);
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 12:46     ` Neil Armstrong
  -1 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:46 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> index 2923977b205a..6bbfaeb23672 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> @@ -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 ? */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

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

* Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
@ 2022-09-22 12:46     ` Neil Armstrong
  0 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:46 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> index 2923977b205a..6bbfaeb23672 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> @@ -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 ? */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 12:46     ` Neil Armstrong
  -1 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:46 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> index fba8e40441cb..41f91829af17 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> @@ -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 ? */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

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

* Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
@ 2022-09-22 12:46     ` Neil Armstrong
  0 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:46 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> index fba8e40441cb..41f91829af17 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> @@ -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 ? */

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 12:49     ` Neil Armstrong
  -1 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:49 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
>   1 file changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
> index 7529a7e6e5df..2ef638b32e8f 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
> @@ -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);


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

Anyway:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

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

* Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
@ 2022-09-22 12:49     ` Neil Armstrong
  0 siblings, 0 replies; 40+ messages in thread
From: Neil Armstrong @ 2022-09-22 12:49 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 13:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
>   1 file changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
> index 7529a7e6e5df..2ef638b32e8f 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
> @@ -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);


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

Anyway:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 0/7] Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-22 14:26   ` Andrew Halaney
  -1 siblings, 0 replies; 40+ messages in thread
From: Andrew Halaney @ 2022-09-22 14:26 UTC (permalink / raw)
  To: Yuan Can
  Cc: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy

On Thu, Sep 22, 2022 at 11:12:21AM +0000, Yuan Can wrote:
> 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(-)
> 
> -- 
> 2.17.1
> 

The whole series looks good to me:

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>


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

* Re: [PATCH 0/7] Use dev_err_probe() to simplify code
@ 2022-09-22 14:26   ` Andrew Halaney
  0 siblings, 0 replies; 40+ messages in thread
From: Andrew Halaney @ 2022-09-22 14:26 UTC (permalink / raw)
  To: Yuan Can
  Cc: agross, andersson, konrad.dybcio, kishon, vkoul, linux-arm-msm,
	linux-phy

On Thu, Sep 22, 2022 at 11:12:21AM +0000, Yuan Can wrote:
> 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(-)
> 
> -- 
> 2.17.1
> 

The whole series looks good to me:

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 1/7] phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
>   1 file changed, 7 insertions(+), 14 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 1/7] phy: qcom-qmp-combo: Use dev_err_probe() to simplify code
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 21 +++++++--------------
>   1 file changed, 7 insertions(+), 14 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/7] phy: qcom-qmp-pcie: Use dev_err_probe() to simplify code
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 4/7] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 4/7] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code
@ 2022-09-22 18:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:03 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:04     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:04 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 5/7] phy: qcom-qmp-usb: Use dev_err_probe() to simplify code
@ 2022-09-22 18:04     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:04 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:05     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:05 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
>   1 file changed, 9 insertions(+), 18 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 6/7] phy: qcom-qusb2: Use dev_err_probe() to simplify code
@ 2022-09-22 18:05     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:05 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qusb2.c | 27 +++++++++------------------
>   1 file changed, 9 insertions(+), 18 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 7/7] phy: qcom-snps: Use dev_err_probe() to simplify code
  2022-09-22 11:12   ` Yuan Can
@ 2022-09-22 18:05     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:05 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 7/7] phy: qcom-snps: Use dev_err_probe() to simplify code
@ 2022-09-22 18:05     ` Dmitry Baryshkov
  0 siblings, 0 replies; 40+ messages in thread
From: Dmitry Baryshkov @ 2022-09-22 18:05 UTC (permalink / raw)
  To: Yuan Can, agross, andersson, konrad.dybcio, kishon, vkoul,
	linux-arm-msm, linux-phy

On 22/09/2022 14:12, 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.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 0/7] Use dev_err_probe() to simplify code
  2022-09-22 11:12 ` Yuan Can
@ 2022-09-24  6:38   ` Vinod Koul
  -1 siblings, 0 replies; 40+ messages in thread
From: Vinod Koul @ 2022-09-24  6:38 UTC (permalink / raw)
  To: Yuan Can
  Cc: agross, andersson, konrad.dybcio, kishon, linux-arm-msm, linux-phy

On 22-09-22, 11:12, Yuan Can wrote:
> 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

-- 
~Vinod

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

* Re: [PATCH 0/7] Use dev_err_probe() to simplify code
@ 2022-09-24  6:38   ` Vinod Koul
  0 siblings, 0 replies; 40+ messages in thread
From: Vinod Koul @ 2022-09-24  6:38 UTC (permalink / raw)
  To: Yuan Can
  Cc: agross, andersson, konrad.dybcio, kishon, linux-arm-msm, linux-phy

On 22-09-22, 11:12, Yuan Can wrote:
> 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

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

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

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:12 [PATCH 0/7] Use dev_err_probe() to simplify code Yuan Can
2022-09-22 11:12 ` Yuan Can
2022-09-22 11:12 ` [PATCH 1/7] phy: qcom-qmp-combo: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 18:03   ` Dmitry Baryshkov
2022-09-22 18:03     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 2/7] phy: qcom-qmp-pcie-msm8996: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 18:03   ` Dmitry Baryshkov
2022-09-22 18:03     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 3/7] phy: qcom-qmp-pcie: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 12:46   ` Neil Armstrong
2022-09-22 12:46     ` Neil Armstrong
2022-09-22 18:03   ` Dmitry Baryshkov
2022-09-22 18:03     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 4/7] phy: qcom-qmp-ufs: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 18:03   ` Dmitry Baryshkov
2022-09-22 18:03     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 5/7] phy: qcom-qmp-usb: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 12:46   ` Neil Armstrong
2022-09-22 12:46     ` Neil Armstrong
2022-09-22 18:04   ` Dmitry Baryshkov
2022-09-22 18:04     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 6/7] phy: qcom-qusb2: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 12:49   ` Neil Armstrong
2022-09-22 12:49     ` Neil Armstrong
2022-09-22 18:05   ` Dmitry Baryshkov
2022-09-22 18:05     ` Dmitry Baryshkov
2022-09-22 11:12 ` [PATCH 7/7] phy: qcom-snps: " Yuan Can
2022-09-22 11:12   ` Yuan Can
2022-09-22 18:05   ` Dmitry Baryshkov
2022-09-22 18:05     ` Dmitry Baryshkov
2022-09-22 14:26 ` [PATCH 0/7] " Andrew Halaney
2022-09-22 14:26   ` Andrew Halaney
2022-09-24  6:38 ` Vinod Koul
2022-09-24  6:38   ` Vinod Koul

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.