ipq806x: add patch to fix broken usb3
[openwrt/staging/lynxis.git] / target / linux / ipq806x / patches-5.4 / 0077-phy-dwc3-qcom-fix-kernel-5_4.patch
1 --- a/drivers/phy/qualcomm/phy-qcom-dwc3.c
2 +++ b/drivers/phy/qualcomm/phy-qcom-dwc3.c
3 @@ -491,7 +491,6 @@ static int qcom_dwc3_phy_probe(struct pl
4 struct qcom_dwc3_usb_phy *phy_dwc3;
5 struct phy_provider *phy_provider;
6 struct phy *generic_phy;
7 - struct resource *res;
8 const struct of_device_id *match;
9 const struct qcom_dwc3_phy_drvdata *data;
10 struct device_node *np;
11 @@ -505,7 +504,17 @@ static int qcom_dwc3_phy_probe(struct pl
12
13 phy_dwc3->dev = &pdev->dev;
14
15 - phy_dwc3->base = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "regmap");
16 + np = of_parse_phandle(pdev->dev.of_node, "regmap", 0);
17 + if (!np)
18 + return -ENODEV;
19 +
20 + if (!of_device_is_compatible(np, "syscon"))
21 + return -EINVAL;
22 +
23 + phy_dwc3->base = device_node_to_regmap(np);
24 +
25 + of_node_put(np);
26 +
27 if (IS_ERR_OR_NULL(phy_dwc3->base))
28 return PTR_ERR_OR_ZERO(phy_dwc3->base) ? : -EINVAL;
29