Re: [PATCH v1] ASoC: tlv320aic32x4: handle regmap_read error gracefully
From: Mark Brown
Date: Thu Jan 09 2020 - 15:38:23 EST
On Fri, Dec 27, 2019 at 04:20:56PM +0100, Peter Seiderer wrote:
> @@ -338,7 +338,8 @@ static unsigned long clk_aic32x4_div_recalc_rate(struct clk_hw *hw,
> unsigned int val;
> - regmap_read(div->regmap, div->reg, &val);
> + if (regmap_read(div->regmap, div->reg, &val))
> + return 0;
Is this the best fix - shouldn't we be returning an error here? We
don't know what the value programmed into the device actually is so zero
might be wrong, and we still have the risk that the value we read from
the device may be zero if the device is misprogrammed.
Attachment:
signature.asc
Description: PGP signature