[PATCH v1 3/4] ASoC: Intel: bytcr_rt5651: use devm_clk_get_optional() for mclk

Mark Brown broonie at kernel.org
Wed Oct 6 19:06:24 CEST 2021


On Wed, Oct 06, 2021 at 07:50:45PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 06, 2021 at 11:37:24AM -0500, Pierre-Louis Bossart wrote:

> > By looking at this code only one cannot really visualize that it's a
> > no-op. I personally prefer to see explicit intent rather than have to
> > dig hundreds of lines below what this clock is optional.

> > I am also not even sure that in real products this clock is actually
> > optional,

> The code tells that it's optional. If it's not the case, the code has
> to be fixed accordingly.

AIUI with the clock API the idiomatic thing is that any optionality is
handled at the point where the clock is acquired - if the clock is
optional you end up with NULL which in the clock API is a dummy clock
and ignored.  The rest of the code then doesn't need to worry about any
of this stuff and the handling can only be in one place.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20211006/2a6ebb44/attachment-0001.sig>


More information about the Alsa-devel mailing list