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: 13016879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57344C38A2D for ; Mon, 24 Oct 2022 09:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nnYa3ZQFb9i8R6oZ6fvlwTqAy91ax9mZveQ0N16XetI=; b=J1tMxMp+dG0XMH Wc2sZYYF/pDuaMxtY40zGl3BfFSeFfyBlbfLncByw1Z2NVf+NRrl78Ls1T22sKVvnoB5qQ+Luh8Qn VniFkmZNJ6dzr162ca/L2xBOR0WIiLp+KnYpKoaTKUwYkWSRElVG97BQgNUf3juFuGByjqkXsc9CC vziMIv0gQXN5uBd8CzSx0qr9ktHD9jaNjUUavlQhZc4BwuB1RhwLjBWu3d/f+B3sZ/3xT11LaVsLn Tw8RCLyZBxRTI+jJlTIb3qTibuYjHSDVG/8ihfqqWJETmUar5SC/OPMCNvmtYlHqKLfxWzRagy6fp tctNUx3oIw++cu3lFG0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1omtL4-000GfT-GF; Mon, 24 Oct 2022 09:01:42 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1omtL1-000GcO-HT for linux-phy@lists.infradead.org; Mon, 24 Oct 2022 09:01:40 +0000 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 4B83F61089; 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_020139_631542_39266ACD X-CRM114-Status: GOOD ( 16.64 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org 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);