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

authored by

Johan Hovold and committed by
Vinod Koul
8ec02ba8 2a55ec4f

+10 -26
+10 -26
drivers/phy/qualcomm/phy-qcom-qmp-usb.c
··· 2471 2471 void __iomem *serdes; 2472 2472 const struct qmp_phy_cfg *cfg = NULL; 2473 2473 struct qmp_usb *qmp; 2474 - int num, id; 2475 2474 int ret; 2476 2475 2477 2476 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); ··· 2506 2507 if (ret) 2507 2508 return ret; 2508 2509 2509 - num = of_get_available_child_count(dev->of_node); 2510 - /* do we have a rogue child node ? */ 2511 - if (num > 1) 2510 + child = of_get_next_available_child(dev->of_node, NULL); 2511 + if (!child) 2512 2512 return -EINVAL; 2513 2513 2514 2514 pm_runtime_set_active(dev); 2515 2515 ret = devm_pm_runtime_enable(dev); 2516 2516 if (ret) 2517 - return ret; 2517 + goto err_node_put; 2518 2518 /* 2519 2519 * Prevent runtime pm from being ON by default. Users can enable 2520 2520 * it using power/control in sysfs. 2521 2521 */ 2522 2522 pm_runtime_forbid(dev); 2523 2523 2524 - id = 0; 2525 - for_each_available_child_of_node(dev->of_node, child) { 2526 - /* Create per-lane phy */ 2527 - ret = qmp_usb_create(dev, child, serdes, cfg); 2528 - if (ret) { 2529 - dev_err(dev, "failed to create lane%d phy, %d\n", 2530 - id, ret); 2531 - goto err_node_put; 2532 - } 2524 + ret = qmp_usb_create(dev, child, serdes, cfg); 2525 + if (ret) 2526 + goto err_node_put; 2533 2527 2534 - /* 2535 - * Register the pipe clock provided by phy. 2536 - * See function description to see details of this pipe clock. 2537 - */ 2538 - ret = phy_pipe_clk_register(qmp, child); 2539 - if (ret) { 2540 - dev_err(qmp->dev, 2541 - "failed to register pipe clock source\n"); 2542 - goto err_node_put; 2543 - } 2528 + ret = phy_pipe_clk_register(qmp, child); 2529 + if (ret) 2530 + goto err_node_put; 2544 2531 2545 - id++; 2546 - } 2532 + of_node_put(child); 2547 2533 2548 2534 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 2549 2535