[alsa-devel] [PATCH 4/5] ASoC: max98088: Add master clock handling
Mark Brown
broonie at kernel.org
Tue Sep 25 19:17:42 CEST 2018
On Tue, Sep 25, 2018 at 04:23:51PM +0200, Marco Felsch wrote:
> From: Andreas Färber <afaerber at suse.de>
>
> If master clock is provided through device tree, then update
> the master clock frequency during set_sysclk.
This changelog suggests that the clock is optional...
> + if (!IS_ERR(max98088->mclk)) {
> + freq = clk_round_rate(max98088->mclk, freq);
> + clk_set_rate(max98088->mclk, freq);
> + }
...as does much of the code (note BTw that this ignores errors setting
the clock)...
> + max98088->mclk = devm_clk_get(&i2c->dev, "mclk");
> + if (IS_ERR(max98088->mclk)) {
> + if (PTR_ERR(max98088->mclk) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + dev_err(&i2c->dev, "Invalid MCLK\n");
> + return -EINVAL;
> + }
> +
...but the probe function makes it mandatory (and also throws away the
error code from clk_get() if it's not -EPROBE_DEFER). Is this the best
choice? It seems inconsistent anyway.
-------------- 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/20180925/e31189ba/attachment.sig>
More information about the Alsa-devel
mailing list