diff mbox series

[42/43] phy: qcom-qmp-pcie-msm8996: drop reset lane suffix

Message ID 20220705094239.17174-43-johan+linaro@kernel.org
State Superseded
Headers show
Series phy: qcom,qmp: fix dt-bindings and deprecate lane suffix | expand

Commit Message

Johan Hovold July 5, 2022, 9:42 a.m. UTC
The lane reset is defined in the "lane" node so there's no need to keep
adding a redundant lane-number suffix to the reset name.

Drop the lane-number suffix from the lane reset name, but continue
supporting the legacy name as a fall back.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Krzysztof Kozlowski July 5, 2022, 10:21 a.m. UTC | #1
On 05/07/2022 11:42, Johan Hovold wrote:
> The lane reset is defined in the "lane" node so there's no need to keep
> adding a redundant lane-number suffix to the reset name.
> 
> Drop the lane-number suffix from the lane reset name, but continue
> supporting the legacy name as a fall back.
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
> index b8481dab54db..9ddb42fa5f7a 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
> @@ -915,9 +915,12 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
>  				     "failed to get lane%d pipe clock\n", id);
>  	}
>  
> -	/* Get lane reset, if any */
> -	snprintf(prop_name, sizeof(prop_name), "lane%d", id);
> -	qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
> +	qphy->lane_rst = of_reset_control_get_exclusive(np, "lane");

As well, just grab first entry and ABI is kept stable.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
index b8481dab54db..9ddb42fa5f7a 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
@@ -915,9 +915,12 @@  int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
 				     "failed to get lane%d pipe clock\n", id);
 	}
 
-	/* Get lane reset, if any */
-	snprintf(prop_name, sizeof(prop_name), "lane%d", id);
-	qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
+	qphy->lane_rst = of_reset_control_get_exclusive(np, "lane");
+	if (IS_ERR(qphy->lane_rst) && PTR_ERR(qphy->lane_rst) != -EPROBE_DEFER) {
+		/* Fall back to the legacy lane reset name. */
+		snprintf(prop_name, sizeof(prop_name), "lane%d", id);
+		qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
+	}
 	if (IS_ERR(qphy->lane_rst)) {
 		dev_err(dev, "failed to get lane%d reset\n", id);
 		return PTR_ERR(qphy->lane_rst);