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: clean up device-tree parsing

Since the QMP driver split there will be at most a single child node so
drop the obsolete iteration construct.

While at it, drop the verbose error logging that would have been
printed also on probe deferrals.

Note that there's no need to check if there are additional child nodes
(the kernel is not a devicetree validator), but let's return an error if
there are no child nodes at all for now.

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-5-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
393ed5d5 2fdedef3

+9 -25
+9 -25
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 2250 2250 void __iomem *serdes; 2251 2251 const struct qmp_phy_cfg *cfg = NULL; 2252 2252 struct qmp_pcie *qmp; 2253 - int num, id; 2254 2253 int ret; 2255 2254 2256 2255 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); ··· 2282 2283 if (ret) 2283 2284 return ret; 2284 2285 2285 - num = of_get_available_child_count(dev->of_node); 2286 - /* do we have a rogue child node ? */ 2287 - if (num > 1) 2286 + child = of_get_next_available_child(dev->of_node, NULL); 2287 + if (!child) 2288 2288 return -EINVAL; 2289 2289 2290 - id = 0; 2291 - for_each_available_child_of_node(dev->of_node, child) { 2292 - /* Create per-lane phy */ 2293 - ret = qmp_pcie_create(dev, child, serdes, cfg); 2294 - if (ret) { 2295 - dev_err(dev, "failed to create lane%d phy, %d\n", 2296 - id, ret); 2297 - goto err_node_put; 2298 - } 2290 + ret = qmp_pcie_create(dev, child, serdes, cfg); 2291 + if (ret) 2292 + goto err_node_put; 2299 2293 2300 - /* 2301 - * Register the pipe clock provided by phy. 2302 - * See function description to see details of this pipe clock. 2303 - */ 2304 - ret = phy_pipe_clk_register(qmp, child); 2305 - if (ret) { 2306 - dev_err(qmp->dev, 2307 - "failed to register pipe clock source\n"); 2308 - goto err_node_put; 2309 - } 2294 + ret = phy_pipe_clk_register(qmp, child); 2295 + if (ret) 2296 + goto err_node_put; 2310 2297 2311 - id++; 2312 - } 2298 + of_node_put(child); 2313 2299 2314 2300 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 2315 2301