ASoC: max9867: Improve error logging

Tell user what are clock rate limits and reindent log messages.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Ladislav Michl 2018-03-01 15:19:53 +01:00 committed by Mark Brown
parent 3ac9ce8858
commit 8b9c716aad
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 4 additions and 3 deletions

View File

@ -291,7 +291,9 @@ static int max9867_set_dai_sysclk(struct snd_soc_dai *codec_dai,
value |= MAX9867_PSCLK_40_60; value |= MAX9867_PSCLK_40_60;
max9867->pclk = freq/4; max9867->pclk = freq/4;
} else { } else {
pr_err("bad clock frequency %d", freq); dev_err(component->dev,
"Invalid clock frequency %uHz (required 10-60MHz)\n",
freq);
return -EINVAL; return -EINVAL;
} }
value = value << MAX9867_PSCLK_SHIFT; value = value << MAX9867_PSCLK_SHIFT;
@ -486,8 +488,7 @@ static int max9867_i2c_probe(struct i2c_client *i2c,
max9867->regmap = devm_regmap_init_i2c(i2c, &max9867_regmap); max9867->regmap = devm_regmap_init_i2c(i2c, &max9867_regmap);
if (IS_ERR(max9867->regmap)) { if (IS_ERR(max9867->regmap)) {
ret = PTR_ERR(max9867->regmap); ret = PTR_ERR(max9867->regmap);
dev_err(&i2c->dev, dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
"Failed to allocate regmap: %d\n", ret);
return ret; return ret;
} }
ret = regmap_read(max9867->regmap, ret = regmap_read(max9867->regmap,