Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: qcom-qmp-pcie: restructure PHY creation

In preparation for supporting devicetree bindings which do not use a
child node, move the PHY creation to probe() proper and parse the serdes
resource in what is now the legacy devicetree helper.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221105145939.20318-13-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
7bc609e3 30638230

+17 -19
+17 -19
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 2147 2147 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); 2148 2148 } 2149 2149 2150 - static int qmp_pcie_create(struct qmp_pcie *qmp, struct device_node *np) 2150 + static int qmp_pcie_parse_dt_legacy(struct qmp_pcie *qmp, struct device_node *np) 2151 2151 { 2152 + struct platform_device *pdev = to_platform_device(qmp->dev); 2152 2153 const struct qmp_phy_cfg *cfg = qmp->cfg; 2153 2154 struct device *dev = qmp->dev; 2154 - struct phy *generic_phy; 2155 - int ret; 2156 2155 2157 - qmp->mode = PHY_MODE_PCIE_RC; 2156 + qmp->serdes = devm_platform_ioremap_resource(pdev, 0); 2157 + if (IS_ERR(qmp->serdes)) 2158 + return PTR_ERR(qmp->serdes); 2158 2159 2159 2160 /* 2160 2161 * Get memory resources for the PHY: ··· 2210 2209 "failed to get pipe clock\n"); 2211 2210 } 2212 2211 2213 - generic_phy = devm_phy_create(dev, np, &qmp_pcie_phy_ops); 2214 - if (IS_ERR(generic_phy)) { 2215 - ret = PTR_ERR(generic_phy); 2216 - dev_err(dev, "failed to create PHY: %d\n", ret); 2217 - return ret; 2218 - } 2219 - 2220 - qmp->phy = generic_phy; 2221 - phy_set_drvdata(generic_phy, qmp); 2222 - 2223 2212 return 0; 2224 2213 } 2225 2214 ··· 2234 2243 WARN_ON_ONCE(!qmp->cfg->pwrdn_ctrl); 2235 2244 WARN_ON_ONCE(!qmp->cfg->phy_status); 2236 2245 2237 - qmp->serdes = devm_platform_ioremap_resource(pdev, 0); 2238 - if (IS_ERR(qmp->serdes)) 2239 - return PTR_ERR(qmp->serdes); 2240 - 2241 2246 ret = qmp_pcie_clk_init(qmp); 2242 2247 if (ret) 2243 2248 return ret; ··· 2250 2263 if (!child) 2251 2264 return -EINVAL; 2252 2265 2253 - ret = qmp_pcie_create(qmp, child); 2266 + ret = qmp_pcie_parse_dt_legacy(qmp, child); 2254 2267 if (ret) 2255 2268 goto err_node_put; 2256 2269 2257 2270 ret = phy_pipe_clk_register(qmp, child); 2258 2271 if (ret) 2259 2272 goto err_node_put; 2273 + 2274 + qmp->mode = PHY_MODE_PCIE_RC; 2275 + 2276 + qmp->phy = devm_phy_create(dev, child, &qmp_pcie_phy_ops); 2277 + if (IS_ERR(qmp->phy)) { 2278 + ret = PTR_ERR(qmp->phy); 2279 + dev_err(dev, "failed to create PHY: %d\n", ret); 2280 + goto err_node_put; 2281 + } 2282 + 2283 + phy_set_drvdata(qmp->phy, qmp); 2260 2284 2261 2285 of_node_put(child); 2262 2286