[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23e51463-1d95-59dd-c449-d4245aadcab5@katsuster.net>
Date: Thu, 5 Sep 2019 00:46:02 +0900
From: Katsuhiro Suzuki <katsuhiro@...suster.net>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Mark Brown <broonie@...nel.org>,
David Yang <yangxiaohua@...rest-semi.com>,
Daniel Drake <drake@...lessm.com>,
Hans de Goede <hdegoede@...hat.com>,
ALSA Development Mailing List <alsa-devel@...a-project.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK
Hello Andy,
Thank you for reviewing.
On 2019/09/04 23:37, Andy Shevchenko wrote:
> On Tue, Sep 3, 2019 at 7:54 PM Katsuhiro Suzuki <katsuhiro@...suster.net> wrote:
>>
>> This patch introduce clock property for MCLK master freq control.
>> Driver will set rate of MCLK master if set_sysclk is called and
>> changing sysclk by board driver.
>>
>> Signed-off-by: Katsuhiro Suzuki <katsuhiro@...suster.net>
>
>
>> + if (es8316->mclk) {
>
> You don't need this if clock has been requested as optional
> (clk_get_optional() or so).
>
>> + ret = clk_set_rate(es8316->mclk, freq);
>> + if (ret)
>> + return ret;
>> + }
>
>> + es8316->mclk = devm_clk_get(component->dev, "mclk");
>> + if (PTR_ERR(es8316->mclk) == -EPROBE_DEFER)
>> + return -EPROBE_DEFER;
>> + if (IS_ERR(es8316->mclk)) {
>> + dev_err(component->dev, "clock is invalid, ignored\n");
>> + es8316->mclk = NULL;
>> + }
>
> devm_clk_get_optional()
>
>> + if (es8316->mclk) {
>
> Ditto as above.
>
>> + ret = clk_prepare_enable(es8316->mclk);
>> + if (ret) {
>> + dev_err(component->dev, "unable to enable clock\n");
>> + return ret;
>> + }
>> + }
>
>> + if (es8316->mclk)
>
> Ditto.
>
>> + clk_disable_unprepare(es8316->mclk);
>> +}
>
>
Indeed, NULL check of MCLK is not needed.
I'll make and send fixup patch.
Best Regards,
Katsuhiro Suzuki
Powered by blists - more mailing lists