linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Katsuhiro Suzuki <katsuhiro@katsuster.net>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	David Yang <yangxiaohua@everest-semi.com>,
	Daniel Drake <drake@endlessm.com>,
	Hans de Goede <hdegoede@redhat.com>,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK
Date: Thu, 5 Sep 2019 00:46:02 +0900	[thread overview]
Message-ID: <23e51463-1d95-59dd-c449-d4245aadcab5@katsuster.net> (raw)
In-Reply-To: <CAHp75Vcm0yus5GpZEttdr_C07gmQXeNJ16gb_TFLUTvGkc164w@mail.gmail.com>

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@katsuster.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@katsuster.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

  reply	other threads:[~2019-09-04 15:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 16:53 [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Katsuhiro Suzuki
2019-09-03 16:53 ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Katsuhiro Suzuki
2019-09-03 18:00   ` Applied "ASoC: es8316: add clock control of MCLK" to the asoc tree Mark Brown
2019-09-04 14:37   ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Andy Shevchenko
2019-09-04 15:46     ` Katsuhiro Suzuki [this message]
2019-09-03 16:53 ` [PATCH v3 3/4] ASoC: es8316: support fixed clock rate Katsuhiro Suzuki
2019-09-03 17:29   ` Mark Brown
2019-09-03 16:53 ` [PATCH v3 4/4] ASoC: es8316: add DT-bindings Katsuhiro Suzuki
2019-09-03 18:00   ` Applied "ASoC: es8316: add DT-bindings" to the asoc tree Mark Brown
2019-09-03 17:48 ` [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Mark Brown
2019-09-04 15:06   ` Katsuhiro Suzuki
2019-09-04 15:30     ` Mark Brown
2019-09-04 15:55       ` Katsuhiro Suzuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23e51463-1d95-59dd-c449-d4245aadcab5@katsuster.net \
    --to=katsuhiro@katsuster.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=drake@endlessm.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangxiaohua@everest-semi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).