Skip to contentSkip to conversation

phy: qcom-qmp: misc cleanups

PATCH In review Johan Hovold 2 participants 7 messages Nov 11, 2022 – Nov 14, 2022

Subsystems (2)
lore
Share & tools
lore
#3 lore raw

PATCH 2/3 phy: qcom-qmp-usb: drop redundant clock allocation

In reply to Johan Hovold

Since the QMP driver split, there is no reason to allocate the fixed-rate pipe clock structure separately from the driver data.

---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +3 -5
index 8b111b7087b9..27f2398ebf08 100644
@@ -1485,6 +1485,8 @@ struct qmp_usb {
 	enum phy_mode mode;
 
 	struct phy *phy;
+
+	struct clk_fixed_rate pipe_clk_fixed;
 };
 
 static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val)
@@ -2357,7 +2359,7 @@ static void phy_clk_release_provider(void *res)
  */
 static int phy_pipe_clk_register(struct qmp_usb *qmp, struct device_node *np)
 {
-	struct clk_fixed_rate *fixed;
+	struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed;
 	struct clk_init_data init = { };
 	int ret;
 
@@ -2367,10 +2369,6 @@ static int phy_pipe_clk_register(struct qmp_usb *qmp, struct device_node *np)
 		return ret;
 	}
 
-	fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL);
-	if (!fixed)
-		return -ENOMEM;
-
 	init.ops = &clk_fixed_rate_ops;
 
 	/* controllers using QMP phys use 125MHz pipe clock interface */
Signature · 1 line
2.37.4
#5 lore raw

PATCH 3/3 phy: qcom-qmp-pcie: drop redundant clock allocation

In reply to Johan Hovold

Since the QMP driver split, there is no reason to allocate the fixed-rate pipe clock structure separately from the driver data.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3 -5
index 328708a09c37..68cafc9561ae 100644
@@ -1546,6 +1546,8 @@ struct qmp_pcie {
 
 	struct phy *phy;
 	int mode;
+
+	struct clk_fixed_rate pipe_clk_fixed;
 };
 
 static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val)
@@ -2410,7 +2412,7 @@ static void phy_clk_release_provider(void *res)
  */
 static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np)
 {
-	struct clk_fixed_rate *fixed;
+	struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed;
 	struct clk_init_data init = { };
 	int ret;
 
@@ -2420,10 +2422,6 @@ static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np)
 		return ret;
 	}
 
-	fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL);
-	if (!fixed)
-		return -ENOMEM;
-
 	init.ops = &clk_fixed_rate_ops;
 
 	/*
Signature · 1 line
2.37.4
#1 lore raw

PATCH 1/3 phy: qcom-qmp: drop unused type header

In reply to Johan Hovold

The PHY type defines are no longer used in the PCIe, UFS and USB QMP drivers so drop the corresponding include.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 --
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c         | 2 --
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c          | 2 --
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c          | 2 --
 4 files changed, 8 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0 -2
index ff198d846fd2..a088477e274f 100644
@@ -20,8 +20,6 @@
 #include <linux/reset.h>
 #include <linux/slab.h>
 
-#include <dt-bindings/phy/phy.h>
-
 #include "phy-qcom-qmp.h"
 
 /* QPHY_SW_RESET bit */
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -2
index 111716e25b17..328708a09c37 100644
@@ -23,8 +23,6 @@
 #include <linux/reset.h>
 #include <linux/slab.h>
 
-#include <dt-bindings/phy/phy.h>
-
 #include "phy-qcom-qmp.h"
 
 /* QPHY_SW_RESET bit */
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0 -2
index 189103d1bd18..318eea35b972 100644
@@ -20,8 +20,6 @@
 #include <linux/reset.h>
 #include <linux/slab.h>
 
-#include <dt-bindings/phy/phy.h>
-
 #include "phy-qcom-qmp.h"
 
 /* QPHY_SW_RESET bit */
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0 -2
index 9b1f8c9d0eb8..8b111b7087b9 100644
@@ -20,8 +20,6 @@
 #include <linux/reset.h>
 #include <linux/slab.h>
 
-#include <dt-bindings/phy/phy.h>
-
 #include "phy-qcom-qmp.h"
 
 /* QPHY_SW_RESET bit */
Signature · 1 line
2.37.4
#0 lore raw

cover phy: qcom-qmp: misc cleanups

Here are three cleanups to the non-combo QMP drivers for smaller issues found while reworking the combo driver.

Johan

Johan Hovold (3):
phy: qcom-qmp: drop unused type header
phy: qcom-qmp-usb: drop redundant clock allocation
phy: qcom-qmp-pcie: drop redundant clock allocation

 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c |  2 --
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c         | 10 +++-------
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c          |  2 --
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c          | 10 +++-------
 4 files changed, 6 insertions(+), 18 deletions(-)
Signature · 1 line
2.37.4
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] phy: qcom-qmp: drop unused type header

In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

The PHY type defines are no longer used in the PCIe, UFS and USB QMP drivers so drop the corresponding include.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 --
  drivers/phy/qualcomm/phy-qcom-qmp-pcie.c         | 2 --
  drivers/phy/qualcomm/phy-qcom-qmp-ufs.c          | 2 --
  drivers/phy/qualcomm/phy-qcom-qmp-usb.c          | 2 --
  4 files changed, 8 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] phy: qcom-qmp-usb: drop redundant clock allocation

In reply to Johan Hovold
Quoted 7 lines · Johan Hovold

Since the QMP driver split, there is no reason to allocate the fixed-rate pipe clock structure separately from the driver data.

---
  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 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 v1 3/3
#6 lore raw

Re: [PATCH 3/3] phy: qcom-qmp-pcie: drop redundant clock allocation

In reply to Johan Hovold
Quoted 7 lines · Johan Hovold

Since the QMP driver split, there is no reason to allocate the fixed-rate pipe clock structure separately from the driver data.

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


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