From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1D35C433ED for ; Mon, 12 Apr 2021 20:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3F7B61287 for ; Mon, 12 Apr 2021 20:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238662AbhDLU1h (ORCPT ); Mon, 12 Apr 2021 16:27:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:47070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237641AbhDLU1g (ORCPT ); Mon, 12 Apr 2021 16:27:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAA80611C9; Mon, 12 Apr 2021 20:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618259238; bh=1+4KYDIHljL2KQAWWmokYPPs36J7vyw8CPMGNDtoN5g=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=tsVI6pDsryMf0h9Lje1ZYHwpUCb2/ofclSajhc77s31PaWHr8b7be7KvKdtsWGo1f mz3kyInEMHHxe7ShH1ZN0rjnsJdAPX2iRZwsi2SrpOUdJXF6xJ0dN7gSKebxNuewTj XR6mWGcMYsbinjGSqTxPXJFDar+3Pp8X5xr6fXtw21BDHZpvzEug0awOEwr/U1egR6 ZyJyVEjzF31IFkB1cXlKjeKC9FxEcx+bZzlBF41N5raNy27OtfdFFR2MXJ/SJVYPNa mehS2uvJtMLlTMKQzXybLyMEKcU4t5bnCPMv4vszOeWFT7l57hemQ/btZ/Rb1gGXXb glN4OF2SUBMYg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210410111356.467340-4-jbrunet@baylibre.com> References: <20210410111356.467340-1-jbrunet@baylibre.com> <20210410111356.467340-4-jbrunet@baylibre.com> Subject: Re: [PATCH 3/5] ASoC: rt5682: clock driver must use the clock provider API From: Stephen Boyd Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org To: Jerome Brunet , Liam Girdwood , Mark Brown Date: Mon, 12 Apr 2021 13:27:16 -0700 Message-ID: <161825923642.3764895.16526540466177115640@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Jerome Brunet (2021-04-10 04:13:54) > Clock drivers ops should not the clk API but the clock provider (clk_hw) > instead. >=20 > Signed-off-by: Jerome Brunet > --- > sound/soc/codecs/rt5682.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c > index 0e2a10ed11da..2eee02ac8d49 100644 > --- a/sound/soc/codecs/rt5682.c > +++ b/sound/soc/codecs/rt5682.c > @@ -2634,7 +2634,7 @@ static int rt5682_wclk_set_rate(struct clk_hw *hw, = unsigned long rate, > container_of(hw, struct rt5682_priv, > dai_clks_hw[RT5682_DAI_WCLK_IDX]); > struct snd_soc_component *component =3D rt5682->component; > - struct clk *parent_clk; > + struct clk_hw *parent_hw; > const char * const clk_name =3D clk_hw_get_name(hw); > int pre_div; > unsigned int clk_pll2_out; > @@ -2649,8 +2649,8 @@ static int rt5682_wclk_set_rate(struct clk_hw *hw, = unsigned long rate, > * > * It will set the codec anyway by assuming mclk is 48MHz. > */ > - parent_clk =3D clk_get_parent(hw->clk); > - if (!parent_clk) > + parent_hw =3D clk_hw_get_parent(hw); > + if (!parent_hw) > dev_warn(component->dev, > "Parent mclk of wclk not acquired in driver. Plea= se ensure mclk was provided as %d Hz.\n", > CLK_PLL2_FIN); Can this code be removed? I don't know why we care to check if the clk has a parent or not.