From patchwork Fri Oct 21 11:09:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 6652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp636526wrr; Fri, 21 Oct 2022 04:14:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70TVhkFqLnSVWYuh2vRVtvjTWHU0Qsqbi5zCHbHEo9L7elC/Q9DTHJWoGCGvmr/MtKzIUW X-Received: by 2002:a05:6402:4310:b0:45c:c16c:5c7d with SMTP id m16-20020a056402431000b0045cc16c5c7dmr16638605edc.246.1666350893320; Fri, 21 Oct 2022 04:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666350893; cv=none; d=google.com; s=arc-20160816; b=02cdoZrV9EwMWBioJG3ui7jJCN4LnjZzFZka5Amw9qHgRaOQOb/vAhq1k3uSCk8Jde Z3QE7ngNPaq/yABkpn6J/jdJwh0M+H4fCtixSahkK0EqGCA86ssSzcCjz79UkKShZD8x hJPn05JLZ8vUhsDbic+NxAygIa6m5nagHLozFyHQ/EGvRLzpwqlxDVLXVIKDSrCmPSe/ 6kbqvga1ul54pbzm8udQgetS2nqsBzfryZ2fnZ9a3gx9IXGQUmDe/MIYo6Qlvzi1dT8h AQOp0+gjmHuRS6lpptZcjTkg0OjlCPMgJnxfWTHSsTWVWgiS3qVrikEcSnj65Cw8QDw7 Fh9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XtSC0DOUnTbuIKklr/2utltRFn958x+R2y7JWeiMFh0=; b=sCMtWFXOYjMoVvjyAr8JtOqMty1FN36w5UBZ0pLbn+w3mYJE2E7oJZasbEmowq/1zD KdY0uSGYVGwT+R0PAb/7vtlvDY2S37PiZoutmGGli3YhTpuyb4pT9L9zlhA7AGFlyoXA aQJcZpvCTTmgDDkYHsE+VvRtpYH5XBDJAtjuOXXB3yv//WVaxI95eYxVAo/I8b9hTTRJ FIyILLuw7tUw7W46tdzU3ULdZaKADdjr+oqyuloXNuErjOdG4GPUh/aL62Rpk68kScBp QYzdpwL9arZxViSX80v7eClH6F94I+Pz4Ab3VbyVveG8Tn5Erx38c9lsDX5r662x6qPD qO2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="njx/wF7m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm12-20020a170907948c00b00791a3dd01b6si8360930ejc.864.2022.10.21.04.14.26; Fri, 21 Oct 2022 04:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="njx/wF7m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbiJULLM (ORCPT + 99 others); Fri, 21 Oct 2022 07:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbiJULKr (ORCPT ); Fri, 21 Oct 2022 07:10:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA351189C39; Fri, 21 Oct 2022 04:10:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D7200B82B9E; Fri, 21 Oct 2022 11:10:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7621AC433C1; Fri, 21 Oct 2022 11:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666350643; bh=3R9BPW6QSUhhXBNcO5z3mLwkQgvqyw63TThHmZ5QLXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=njx/wF7mXSH687bj/cE1Bamu1OxiK0SjROBp5r3K+onUp8FwcPWN2SDsgbOkNIIB2 7RHk1Yi6iNZpKdoIqOf7oBw/3vim9VvUgzvwJVqPnZuWVskdWXTKPqaaeRLe3FPMps c+NU5qNdKbJvE3YGiRi67tA/smAc5knViFgVEcAl48qO/k0Lh1BHURwDGdTEa+DYmX 1hfXiDvACCxFGfDHWRFHZZdyBHTxnb3u90XWHTA2Eic4vCJVMWtc3CGAo9tVaRlgfq y1Tz1eh7BvqsAmuYFbNfDizJvdN54YLn0dxuWKdA+mRz7L8218YYqMd8vIF7JBgYdX ZZo7oeNu/pt8Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1olpv4-0007Ka-M9; Fri, 21 Oct 2022 13:10:30 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v3 04/15] phy: qcom-qmp-pcie: clean up device-tree parsing Date: Fri, 21 Oct 2022 13:09:36 +0200 Message-Id: <20221021110947.28103-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221021110947.28103-1-johan+linaro@kernel.org> References: <20221021110947.28103-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747295554269614217?= X-GMAIL-MSGID: =?utf-8?q?1747295554269614217?= 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. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 34 +++++++----------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 667a87e7c917..bc96518ad6b0 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2250,7 +2250,6 @@ static int qmp_pcie_probe(struct platform_device *pdev) void __iomem *serdes; const struct qmp_phy_cfg *cfg = NULL; struct qmp_pcie *qmp; - int num, id; int ret; qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); @@ -2283,34 +2282,19 @@ static int qmp_pcie_probe(struct platform_device *pdev) if (ret) return ret; - num = of_get_available_child_count(dev->of_node); - /* do we have a rogue child node ? */ - if (num > 1) + child = of_get_next_available_child(dev->of_node, NULL); + if (!child) return -EINVAL; - id = 0; - for_each_available_child_of_node(dev->of_node, child) { - /* Create per-lane phy */ - ret = qmp_pcie_create(dev, child, serdes, cfg); - if (ret) { - dev_err(dev, "failed to create lane%d phy, %d\n", - id, ret); - goto err_node_put; - } + ret = qmp_pcie_create(dev, child, serdes, cfg); + if (ret) + goto err_node_put; - /* - * Register the pipe clock provided by phy. - * See function description to see details of this pipe clock. - */ - ret = phy_pipe_clk_register(qmp, child); - if (ret) { - dev_err(qmp->dev, - "failed to register pipe clock source\n"); - goto err_node_put; - } + ret = phy_pipe_clk_register(qmp, child); + if (ret) + goto err_node_put; - id++; - } + of_node_put(child); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);