phy: qcom-qmp: pipe clock cleanups
Subsystems (2)
cover phy: qcom-qmp: pipe clock cleanups
Here are some follow-up cleanups after the recent driver split.
Johan
Johan Hovold (3):
phy: qcom-qmp-pcie: drop obsolete pipe clock type check
phy: qcom-qmp-pcie-msm8996: drop obsolete pipe clock type check
phy: qcom-qmp-usb: clean up pipe clock handling
.../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 19 ++----------------- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 19 ++----------------- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 15 ++------------- 3 files changed, 6 insertions(+), 47 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/3 phy: qcom-qmp-pcie: drop obsolete pipe clock type check
Drop the obsolete pipe clock handling which was used to treat the pipe clock as optional for types other than PCIe and USB and which is no longer needed since splitting the PHY driver.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +2 -17
@@ -2210,26 +2210,11 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);if (IS_ERR (qphy->pipe_clk)) { -if (cfg->type ==PHY_TYPE_PCIE || - 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; - } - qphy->pipe_clk =NULL ; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); } generic_phy =devm_phy_create (dev, np, &qcom_qmp_phy_pcie_ops);
Signature · 1 line
2.35.1
Re: [PATCH 1/3] phy: qcom-qmp-pcie: drop obsolete pipe clock type check
Quoted 31 lines · Johan Hovold
Drop the obsolete pipe clock handling which was used to treat the pipe clock as optional for types other than PCIe and USB and which is no longer needed since splitting the PHY driver.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-10@@ -2210,26 +2210,11 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);if (IS_ERR (qphy->pipe_clk)) { -if (cfg->type ==PHY_TYPE_PCIE || - cfg->type ==PHY_TYPE_USB3 ) { - ret =PTR_ERR (qphy->pipe_clk);
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2218
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +2
-7-if (ret != -EPROBE_DEFER ) -dev_err (dev, -"failed to get lane%d pipe_clk, %d\n" , - id, ret); -return ret; - } - qphy->pipe_clk =NULL ; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); }
Please remove the brackets around a single statement. With that fixed:
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-1generic_phy =devm_phy_create (dev, np, &qcom_qmp_phy_pcie_ops); --2.35.1
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 1/3] phy: qcom-qmp-pcie: drop obsolete pipe clock type check
Quoted 18 lines · Dmitry Baryshkov
Quoted 17 lines · Johan Hovold
Drop the obsolete pipe clock handling which was used to treat the pipe clock as optional for types other than PCIe and USB and which is no longer needed since splitting the PHY driver.
Signed-off-by Johan Hovold <[email protected]>---
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-7if (IS_ERR (qphy->pipe_clk)) { -if (cfg->type ==PHY_TYPE_PCIE || - 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);
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2218
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +2
-3-return ret; - } - qphy->pipe_clk =NULL ; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); }Please remove the brackets around a single statement.
For readability reasons I prefer keeping brackets around statements spanning multiple lines instead of relying on indentation.
Johan
PATCH 2/3 phy: qcom-qmp-pcie-msm8996: drop obsolete pipe clock type check
In reply to Johan HovoldDrop the obsolete pipe clock handling which was used to treat the pipe clock as optional for types other than PCIe and USB and which is no longer needed since splitting the PHY driver.
--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +2 -17
@@ -904,26 +904,11 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);if (IS_ERR (qphy->pipe_clk)) { -if (cfg->type ==PHY_TYPE_PCIE || - 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; - } - qphy->pipe_clk =NULL ; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); }/* Get lane reset, if any */
Signature · 1 line
2.35.1
Re: [PATCH 2/3] phy: qcom-qmp-pcie-msm8996: drop obsolete pipe clock type check
Quoted 31 lines · Johan Hovold
Drop the obsolete pipe clock handling which was used to treat the pipe clock as optional for types other than PCIe and USB and which is no longer needed since splitting the PHY driver.
Signed-off-by Johan Hovold <[email protected]>--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-10@@ -904,26 +904,11 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);if (IS_ERR (qphy->pipe_clk)) { -if (cfg->type ==PHY_TYPE_PCIE || - cfg->type ==PHY_TYPE_USB3 ) { - ret =PTR_ERR (qphy->pipe_clk);
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np, · line 912
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +2
-7-if (ret != -EPROBE_DEFER ) -dev_err (dev, -"failed to get lane%d pipe_clk, %d\n" , - id, ret); -return ret; - } - qphy->pipe_clk =NULL ; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); }
Same comment. Please remove brackets. With that fixed:
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-1/* Get lane reset, if any */ --2.35.1
Signature · 2 lines
With best wishes Dmitry
PATCH 3/3 phy: qcom-qmp-usb: clean up pipe clock handling
In reply to Johan HovoldClean up the pipe clock handling by using dev_err_probe() to handle probe deferral and dropping the obsolete comment that claimed that the pipe clock was optional for some other PHY types.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +2 -13
@@ -2530,22 +2530,11 @@ int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);if (IS_ERR (qphy->pipe_clk)) { - 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; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); } generic_phy =devm_phy_create (dev, np, &qcom_qmp_phy_usb_ops);
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 3/3] phy: qcom-qmp-usb: clean up pipe clock handling
Quoted 27 lines · Johan Hovold
Clean up the pipe clock handling by using
dev_err_probe()to handle probe deferral and dropping the obsolete comment that claimed that the pipe clock was optional for some other PHY types.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-7@@ -2530,22 +2530,11 @@ int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,if (!qphy->pcs_misc)dev_vdbg (dev,"PHY pcs_misc-reg not used\n" ); -/* -* Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3 -* based phys, so they essentially have pipe clock. So, -* we return error in case phy is USB3 or PIPE type. -* Otherwise, we initialize pipe clock to NULL for -* all phys that don't need this. -*/ snprintf (prop_name,sizeof (prop_name),"pipe%d" , id); qphy->pipe_clk =devm_get_clk_from_child (dev, np, prop_name);
drivers/phy/qualcomm/phy-qcom-qmp-usb.c int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id, · line 2538
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +2
-6if (IS_ERR (qphy->pipe_clk)) { - 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; +return dev_err_probe (dev,PTR_ERR (qphy->pipe_clk), +"failed to get lane%d pipe clock\n" , id); }
And here too. Afterwards:
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-1generic_phy =devm_phy_create (dev, np, &qcom_qmp_phy_usb_ops); --2.35.1
Signature · 2 lines
With best wishes Dmitry
Quoted 1 line · Johan Hovold
Here are some follow-up cleanups after the recent driver split.
Applied, thanks
Signature · 6 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy