From patchwork Mon Oct 24 09:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 8256 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp335418wru; Mon, 24 Oct 2022 02:04:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43H9VfeoAYP2T9jnuoL4vvlBiReGpxWK17Ch8boO2IHlRxN0q98sDgKvtu+QRBoRS3Gb/y X-Received: by 2002:a17:907:7627:b0:78d:b6f5:9f15 with SMTP id jy7-20020a170907762700b0078db6f59f15mr26912316ejc.149.1666602259531; Mon, 24 Oct 2022 02:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666602259; cv=none; d=google.com; s=arc-20160816; b=k1OM5tJ+YxbGDpkqCkbkNeeTSRZGV8UZ/vPNAHbZdG205fv+AVJ1n8P1ehxsYlqw7S qCNfbxRkFuHrM7C2tqqZmATTdiOkaBlRrjaWNxvWDGYKqU17uIRP12zX0C6IKtZGaXs+ qPWkx4t0qurfAL0c8R9TmhJ5PWKBIl4PxWWoF5ranPcUII8bFHLMN7NyMJUTN8rM+vA7 HWnsyIQ3eH+nOtE7z7Aoz+8lo1HuA23r851gFMtYRnlS/Imo3yCcyDQGR4r5oSUvw9OT UeyeBPY5qm0ImbHvII1GeNHsKg+i+tDBGDs/jwrrkajTqAkLaAV1J+njY50VmV1+R7hM PO6Q== 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=MLV3JHsKEBAvGjplut/QX4ROz0obncaOekJpJerFCMM=; b=xlaboHBQH8MCZsQ6YVKrk7lmHlg8uT0rpkCIc8fg0MDwdrwCbR4Hg36jKRMXTz/RJv hKFbuADLtOwz1350gXhaAg3OAH8yVFUvzhe60K31MuZR7yUQr7VvsyPEHd/p0vQMuH39 cnyG8oiXF0ufggpVWVZgSUK3dpCruXgeOwkfV/U2gBriRBX13LTbhDMsJu53EGhXDnCU +GpjUsm4zv8m34dgVDnen558l7PRTgwLfhPAaJZcvuT0l1JEGEPUllMRuZo5QoovYI+h hmn6wQduOJO2wOM+zrCkUfaXvaP4euAcXNyRNlM4FpdY7nV05h9EPfRpt4HawP9y86xC tIiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mLLwT6sM; 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 du9-20020a17090772c900b0078df185078esi18793979ejc.663.2022.10.24.02.03.53; Mon, 24 Oct 2022 02:04:19 -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=mLLwT6sM; 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 S230209AbiJXJBp (ORCPT + 99 others); Mon, 24 Oct 2022 05:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbiJXJBk (ORCPT ); Mon, 24 Oct 2022 05:01:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62FA3AE5F; Mon, 24 Oct 2022 02:01:38 -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 52CD36108B; Mon, 24 Oct 2022 09:01:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A619EC433C1; Mon, 24 Oct 2022 09:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666602097; bh=Cv1cUkVYs6lIJWVxJOjj6NKJUi/gghBkbGA1cKOYu9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mLLwT6sMxfenDfX4tcDm2PaQXNlVEFVJwtuypGtXPQniC5s9bqGb7gB6MtcBuNNgL 9qWTXne0nIz0Ocse0smIy7dn40XwEaVfLSG6NmwPC2gNezymw79tA98IiU0B9J2bos p5sh1ohw8uPWHVkzgc3IUK5Ma8kFyoQGGOQut53UZsZqpUjtZPt4I1A0F2tZafuSD6 /y4qgDUGyAVMXmN94wpTwtlavwJcraeNDzauSNs6zTmwG7yYm+BJhkiXiz0epcgQba LC2h0hJ/pTwm7D8coyeqplree5nlar6+Xo25Nv3jGVHDWeMF8ZsWR/KfxQxyvZI5Q1 zV+84a9ElNYaw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1omtKj-00056R-7X; Mon, 24 Oct 2022 11:01:21 +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 03/10] phy: qcom-qmp-ufs: clean up device-tree parsing Date: Mon, 24 Oct 2022 11:00:34 +0200 Message-Id: <20221024090041.19574-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024090041.19574-1-johan+linaro@kernel.org> References: <20221024090041.19574-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747559131116378299?= X-GMAIL-MSGID: =?utf-8?q?1747559131116378299?= 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 Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index b4c3b3d97f52..25744b3576f3 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -1048,7 +1048,6 @@ static int qmp_ufs_probe(struct platform_device *pdev) void __iomem *serdes; const struct qmp_phy_cfg *cfg = NULL; struct qmp_ufs *qmp; - int num, id; int ret; qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); @@ -1074,23 +1073,15 @@ static int qmp_ufs_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_ufs_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_ufs_create(dev, child, serdes, cfg); + if (ret) + goto err_node_put; - id++; - } + of_node_put(child); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);