From patchwork Mon Oct 17 14:53:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1496037wrs; Mon, 17 Oct 2022 08:01:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6fKtIeFblfXYbG1dyVcwVMHba0ilNOPYA6xHw75Zv5nnEpNYKDheiDACkYwGFbQ6HORjDH X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr10790956edc.228.1666018909169; Mon, 17 Oct 2022 08:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666018909; cv=none; d=google.com; s=arc-20160816; b=V4haayTAhIc29rbasmcz2IaWlAugGPK7D62XgiYBN1c7HUUCJATSIdGNpEhWxgRIR/ s+CJ/DzVta1ZvlF4ED2zrAbUOn83rMoUlS+T2uocG8wiwIczdEWv4qB0txYNKkMuG9tA qIUbRWlZ4xt29nZJPZNEgNMTiywq2KJzWUlEBgiWox5jsMUqvLEIXo/+Dp6THR3kJpBg Ob3lnBay2r/73hlbli2U17JWxzYhY4K+W7mGUKh+cy/zfgyQUbMdXdelySiRAv+kVN6f z36c+HD6Frg44XQX0N8sFqXZN9vEwAHGXoipfjQqnW7lsKSVDn+a+7b77r6fzbZUHVKD 1KmQ== 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=gtLjiX2lgjTdxvX8xiq1TYJBNzlbQAtQgDnNeL1ZIcj05sVB4bL7kCv6/URhZsaRr+ akJVFEb66cKM/8g867nA+9OcYK4ni5m5072a/yjK9L/dP5bi+QrUf+URQAxDPZg0ehq3 Uvdpb00yK0GfST1EFZHyXi/2li19u7Y9XyuqLN1sP5ueLs52PpuHdzqtiNLUNpYq9G8I iX+Fmszg6DfrB5voycq4lxlAurTs9Vp+YUqFxpvyw8FzlLmfUNNJ6fhKi5bFmZcpA4qs O4Qa9mYZZ6oZl5gCaG5GeBzIxEhJS47vuiNA/gjqpbgLtqJTsGdweSCu9ZOIZtHkajvQ 1bGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i60zkr9M; 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 g6-20020a1709064e4600b0077cb9bc7984si8066412ejw.181.2022.10.17.08.00.52; Mon, 17 Oct 2022 08:01:49 -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=i60zkr9M; 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 S231670AbiJQPAE (ORCPT + 99 others); Mon, 17 Oct 2022 11:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbiJQO6s (ORCPT ); Mon, 17 Oct 2022 10:58:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65DEF6B8C8; Mon, 17 Oct 2022 07:56:21 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 66FE8611B1; Mon, 17 Oct 2022 14:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1B46C43146; Mon, 17 Oct 2022 14:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666018478; bh=3R9BPW6QSUhhXBNcO5z3mLwkQgvqyw63TThHmZ5QLXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i60zkr9MASFPcL30p8Ir1wUheuzLJgxNhDALpA+2hErpLnwI76fh+kmUbaKN7OFm2 KbIuejJNyq8m6HpMnIkwsJnaJpkP3ZVRu2/ix49biDcE4sISNFxF44YTiaE3MCANKC C6NwYY8AfW0xn1marrhP7FmkoOyLPzwWf+APyJTaRuawkjiC8Mt/JRZ1BkcKsbxAzx 2a2Sj5nSYYmEkMcB0eNrAhTmqwhd2+oAoBVS4OswgJdt1rxFm9AKTc0IVF1WsRTivl I2S5PyV1ixxRjekxu0jBEqMlicBYygsaCrFwVtTx8OLoCkR9wNLXziYfU7E0Lg85TU 4WJ/EcfGIGVuw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okRVc-0005m3-P5; Mon, 17 Oct 2022 16:54:28 +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 04/15] phy: qcom-qmp-pcie: clean up device-tree parsing Date: Mon, 17 Oct 2022 16:53:17 +0200 Message-Id: <20221017145328.22090-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017145328.22090-1-johan+linaro@kernel.org> References: <20221017145328.22090-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1746947443674626855?= X-GMAIL-MSGID: =?utf-8?q?1746947443674626855?= 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);