25 Sep
2018
25 Sep
'18
8:17 p.m.
On Tue, Sep 25, 2018 at 04:23:51PM +0200, Marco Felsch wrote:
From: Andreas Färber afaerber@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.