[openwrt/openwrt] lantiq: ifxmips_pcie: use dev_err_probe

LEDE Commits lede-commits at lists.infradead.org
Wed May 15 01:21:10 PDT 2024


nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/284f12bfa64779ed156262a0351e07af5379be9c

commit 284f12bfa64779ed156262a0351e07af5379be9c
Author: Martin Schiller <ms at dev.tdt.de>
AuthorDate: Wed Apr 10 13:48:50 2024 +0200

    lantiq: ifxmips_pcie: use dev_err_probe
    
    Use dev_err_probe() to get rid of the following warning which is
    seen when the PCIe PHY has not been probed yet:
    pcie-xrx200 1d900000.pcie: failed to get the PCIe PHY
    
    Signed-off-by: Martin Schiller <ms at dev.tdt.de>
---
 .../patches-5.15/0151-lantiq-ifxmips_pcie-use-of.patch      | 13 ++++++-------
 .../patches-6.1/0151-lantiq-ifxmips_pcie-use-of.patch       | 13 ++++++-------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/target/linux/lantiq/patches-5.15/0151-lantiq-ifxmips_pcie-use-of.patch b/target/linux/lantiq/patches-5.15/0151-lantiq-ifxmips_pcie-use-of.patch
index a11ec3ec98..d509c3a76a 100644
--- a/target/linux/lantiq/patches-5.15/0151-lantiq-ifxmips_pcie-use-of.patch
+++ b/target/linux/lantiq/patches-5.15/0151-lantiq-ifxmips_pcie-use-of.patch
@@ -151,7 +151,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
  	}
  	if (i >= IFX_PCIE_PHY_LOOP_CNT) {
  		printk(KERN_ERR "%s link up failed!!!!!\n", __func__);
-@@ -1045,17 +1088,74 @@ pcie_rc_initialize(int pcie_port)
+@@ -1045,17 +1088,73 @@ pcie_rc_initialize(int pcie_port)
  	return 0;
  }
  
@@ -193,10 +193,9 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
 -    
 +
 +    ltq_pcie_phy = devm_phy_get(&pdev->dev, "pcie");
-+    if (IS_ERR(ltq_pcie_phy)) {
-+        dev_err(&pdev->dev, "failed to get the PCIe PHY\n");
-+        return PTR_ERR(ltq_pcie_phy);
-+    }
++    if (IS_ERR(ltq_pcie_phy))
++        return dev_err_probe(&pdev->dev, PTR_ERR(ltq_pcie_phy),
++                             "failed to get the PCIe PHY\n");
 +
 +    ltq_pcie_reset = devm_reset_control_get_shared(&pdev->dev, NULL);
 +    if (IS_ERR(ltq_pcie_reset)) {
@@ -228,7 +227,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
      for (pcie_port = startup_port; pcie_port < IFX_PCIE_CORE_NR; pcie_port++){
  	if (pcie_rc_initialize(pcie_port) == 0) {
  	    IFX_PCIE_PRINT(PCIE_MSG_INIT, "%s: ifx_pcie_cfg_base 0x%p\n", 
-@@ -1067,6 +1167,7 @@ static int __init ifx_pcie_bios_init(voi
+@@ -1067,6 +1166,7 @@ static int __init ifx_pcie_bios_init(voi
                  return -ENOMEM;
              }
              ifx_pcie_controller[pcie_port].pcic.io_map_base = (unsigned long)io_map_base;
@@ -236,7 +235,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
  
              register_pci_controller(&ifx_pcie_controller[pcie_port].pcic);
              /* XXX, clear error status */
-@@ -1083,6 +1184,30 @@ static int __init ifx_pcie_bios_init(voi
+@@ -1083,6 +1183,30 @@ static int __init ifx_pcie_bios_init(voi
  
      return 0;
  }
diff --git a/target/linux/lantiq/patches-6.1/0151-lantiq-ifxmips_pcie-use-of.patch b/target/linux/lantiq/patches-6.1/0151-lantiq-ifxmips_pcie-use-of.patch
index 7cfa675b49..0ab929b2e2 100644
--- a/target/linux/lantiq/patches-6.1/0151-lantiq-ifxmips_pcie-use-of.patch
+++ b/target/linux/lantiq/patches-6.1/0151-lantiq-ifxmips_pcie-use-of.patch
@@ -151,7 +151,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
  	}
  	if (i >= IFX_PCIE_PHY_LOOP_CNT) {
  		printk(KERN_ERR "%s link up failed!!!!!\n", __func__);
-@@ -1045,17 +1088,74 @@ pcie_rc_initialize(int pcie_port)
+@@ -1045,17 +1088,73 @@ pcie_rc_initialize(int pcie_port)
  	return 0;
  }
  
@@ -193,10 +193,9 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
 -    
 +
 +    ltq_pcie_phy = devm_phy_get(&pdev->dev, "pcie");
-+    if (IS_ERR(ltq_pcie_phy)) {
-+        dev_err(&pdev->dev, "failed to get the PCIe PHY\n");
-+        return PTR_ERR(ltq_pcie_phy);
-+    }
++    if (IS_ERR(ltq_pcie_phy))
++        return dev_err_probe(&pdev->dev, PTR_ERR(ltq_pcie_phy),
++                             "failed to get the PCIe PHY\n");
 +
 +    ltq_pcie_reset = devm_reset_control_get_shared(&pdev->dev, NULL);
 +    if (IS_ERR(ltq_pcie_reset)) {
@@ -228,7 +227,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
      for (pcie_port = startup_port; pcie_port < IFX_PCIE_CORE_NR; pcie_port++){
  	if (pcie_rc_initialize(pcie_port) == 0) {
  	    IFX_PCIE_PRINT(PCIE_MSG_INIT, "%s: ifx_pcie_cfg_base 0x%p\n", 
-@@ -1067,6 +1167,7 @@ static int __init ifx_pcie_bios_init(voi
+@@ -1067,6 +1166,7 @@ static int __init ifx_pcie_bios_init(voi
                  return -ENOMEM;
              }
              ifx_pcie_controller[pcie_port].pcic.io_map_base = (unsigned long)io_map_base;
@@ -236,7 +235,7 @@ Signed-off-by: Eddi De Pieri <eddi at depieri.net>
  
              register_pci_controller(&ifx_pcie_controller[pcie_port].pcic);
              /* XXX, clear error status */
-@@ -1083,6 +1184,30 @@ static int __init ifx_pcie_bios_init(voi
+@@ -1083,6 +1183,30 @@ static int __init ifx_pcie_bios_init(voi
  
      return 0;
  }




More information about the lede-commits mailing list