From patchwork Tue Jul 5 09:42: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: 587846 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D87CCCA47B for ; Tue, 5 Jul 2022 09:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232021AbiGEJtk (ORCPT ); Tue, 5 Jul 2022 05:49:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbiGEJtV (ORCPT ); Tue, 5 Jul 2022 05:49:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C912F11C06; Tue, 5 Jul 2022 02:49:06 -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 33D4261941; Tue, 5 Jul 2022 09:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 053BFC36AFB; Tue, 5 Jul 2022 09:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657014545; bh=wcigz9eclfSlWhiIkb00jJF/UDQ56QYbAzKSS2z1YZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kS5qxQ0WIivvIBz1ZT5ed8ga5vBNVzH0vvcvbnikOB18zbQ3Ahg89WGoDp2Hbe4Bk DGXYq6wRxTa2OW0akV/vfoO28WjOHOmlTA9HKtJWfEJYE82znjn8ptSypyWH4gaV9O 4ja90ZV6zmc10StWi9rbSP2aV5t/ukUBE19BnvwtHn0fr6X+uhd5A1EYbzC9MWSUtV 64hcgg4ReNdLJvCj/HOhAAIyOptEZ9tfnwcy/pZG0tI3pKjiibuTHSskFguML9Cnbv p7ZTot6duCOe1YhBYJaA3pO/44+4Ww+hZJWLCFeCm+bpUW4eNT0Zg/dZ5j7WqBsou/ JXo2cVUL8Md1Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1o8fB3-0004Yf-TZ; Tue, 05 Jul 2022 11:49:05 +0200 From: Johan Hovold To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: Andy Gross , Bjorn Andersson , Kishon Vijay Abraham I , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 38/43] phy: qcom-qmp-pcie: drop pipe clock lane suffix Date: Tue, 5 Jul 2022 11:42:34 +0200 Message-Id: <20220705094239.17174-39-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220705094239.17174-1-johan+linaro@kernel.org> References: <20220705094239.17174-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name. Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 385ea3d8de08..254ad25591b9 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, if (!qphy->pcs_misc) dev_vdbg(dev, "PHY pcs_misc-reg not used\n"); - snprintf(prop_name, sizeof(prop_name), "pipe%d", id); - qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name); + qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe"); + if (IS_ERR(qphy->pipe_clk) && PTR_ERR(qphy->pipe_clk) != -EPROBE_DEFER) { + /* Fall back to the legacy pipe clock name. */ + snprintf(prop_name, sizeof(prop_name), "pipe%d", id); + qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name); + } if (IS_ERR(qphy->pipe_clk)) { return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk), "failed to get lane%d pipe clock\n", id);