From patchwork Mon Nov 21 08:50:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 23607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1463492wrr; Mon, 21 Nov 2022 00:56:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QhA/1L+oGFBLefG3kx7aGCh+aquwRxXgdgu3IvmrrS63ydmHpfX+aroEdGv4v/7GwasFL X-Received: by 2002:a17:906:79c4:b0:778:e3e2:8311 with SMTP id m4-20020a17090679c400b00778e3e28311mr15087364ejo.342.1669021015498; Mon, 21 Nov 2022 00:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669021015; cv=none; d=google.com; s=arc-20160816; b=IMOxDAUlCc1VGzfOgMt3kyPjBXeDIDD9lMPSOvJLQNO1nE4+U+Iu+9j3Rwrg+7YPoW vS7nHAT75pk9yKB2yFjfVXyFVeDUTQDCEaCAJNntymhFCMAEMAniKO/nuEbOhdtM1F4D mfr8N/Fl1KLCV3utF4muI2wl/B7EZ+AQiTxnO3kjPpZ8r5z4UpTIHBNT4Kzg1BK11qH3 Rwbfd7dnqedtYRw9MW7qThNV9ZxMU+r+W3xpC7PMWnESTW8uCoLIEReLmHDfQPZgGnzR Fvm4rJjLjUHXs39tLT1UTj8XuQAZSlk9QSXWdR19n2UBmSe6RddAwnkSNc2ygy4jaMKC +xFQ== 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=3cXBFt507qJc3k/Xl6QdQZi6Cjyi2FhEw2yjshecLAE=; b=DRjE5YSqEsV6vFCx21kAorL45F5Tq6egZplnRWrRkhzbG5YEZJ0Fq9kJ1UXX1cSYrg AqHjSxwiztvKyxIWJ3AfSLYX+uCRAOt9AY++/GHnazjRB9L3R3Gx13elLBvP9DR+3T+h oWgR9XlmpZxg/KzUr5mRn5Cz2TluFK79LQHhIzXddUK6m3PbCfoVWcHJu7xP4ZakWA3p rtnHWl28SsjgVYywV4hxRjdg7G/0cRYVPorOqOH1LLB3adRos6ow1Rc241EW7xwOHEQ5 OFeX4t6QP0IeNTu/ZDtBnkpC2/FGaxmhlmXbAgP7mg/To8gKss5gwxkhX5Zy0iHW2Llv aBxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YyFoSCeG; 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 hz3-20020a1709072ce300b0078e06df0d29si8770271ejc.705.2022.11.21.00.56.30; Mon, 21 Nov 2022 00:56:55 -0800 (PST) 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=YyFoSCeG; 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 S230211AbiKUIwv (ORCPT + 99 others); Mon, 21 Nov 2022 03:52:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbiKUIwF (ORCPT ); Mon, 21 Nov 2022 03:52:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 160527FC1B; Mon, 21 Nov 2022 00:52:04 -0800 (PST) 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 057DEB80D66; Mon, 21 Nov 2022 08:51:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9DA5C4FF12; Mon, 21 Nov 2022 08:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669020715; bh=bmsUPacS9Rzat24dJ5K0aImxD9SNax5aw2TjIGoYLjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyFoSCeGHZL6flaDiHGab6T5gW7sxlluRjcCBsvujWHqFKQw0pszU55Low7NBABPz IYS1w9dClqpEh7MMFULeayksK5Mdb1o2+F4C9deZTvdLSVE3CrTSPL5RvQEUXtEXpL qKSF40QqTGkGuOIJNTq/xbg5VsM8H6+nZTUOdUftbW8yL+wR/b4TDWrOV95K6x8PXZ u5DWZv+98XX/0uxA4ZZ6cdD43s0/qp1YwuNPKBZzLFslzpBnri6ofhc2d0qr9WRZPQ jatkAWTdidY9LKDgnB05J9nbYUV2oqfBiFzwNoOrcNG17TjPAK2Yrpbdk/F2itz7s1 7jXCYSYPiVmcQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ox2WT-00088Y-67; Mon, 21 Nov 2022 09:51:25 +0100 From: Johan Hovold To: Vinod Koul Cc: Kishon Vijay Abraham I , 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 09/15] phy: qcom-qmp-combo: separate clock and provider registration Date: Mon, 21 Nov 2022 09:50:52 +0100 Message-Id: <20221121085058.31213-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221121085058.31213-1-johan+linaro@kernel.org> References: <20221121085058.31213-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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?1750095380189983067?= X-GMAIL-MSGID: =?utf-8?q?1750095380189983067?= In preparation for supporting devicetree bindings which do not use child nodes, separate clock registration from clock-provider registration. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 44 +++++++++++------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 1079a16b45f6..89a5b51c770d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2243,7 +2243,6 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np) struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed; struct clk_init_data init = { }; char name[64]; - int ret; snprintf(name, sizeof(name), "%s::pipe_clk", dev_name(qmp->dev)); init.name = name; @@ -2253,19 +2252,7 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np) fixed->fixed_rate = 125000000; fixed->hw.init = &init; - ret = devm_clk_hw_register(qmp->dev, &fixed->hw); - if (ret) - return ret; - - ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw); - if (ret) - return ret; - - /* - * Roll a devm action because the clock provider is the child node, but - * the child node is not actually a device. - */ - return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); + return devm_clk_hw_register(qmp->dev, &fixed->hw); } /* @@ -2436,15 +2423,7 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np) if (ret) return ret; - ret = of_clk_add_hw_provider(np, qcom_qmp_dp_clks_hw_get, qmp); - if (ret) - return ret; - - /* - * Roll a devm action because the clock provider is the child node, but - * the child node is not actually a device. - */ - return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); + return 0; } static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np, @@ -2460,7 +2439,24 @@ static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node * if (ret) return ret; - return 0; + ret = of_clk_add_hw_provider(usb_np, of_clk_hw_simple_get, + &qmp->pipe_clk_fixed.hw); + if (ret) + return ret; + + /* + * Roll a devm action because the clock provider is the child node, but + * the child node is not actually a device. + */ + ret = devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, usb_np); + if (ret) + return ret; + + ret = of_clk_add_hw_provider(dp_np, qcom_qmp_dp_clks_hw_get, qmp); + if (ret) + return ret; + + return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, dp_np); } static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np)