Re: [PATCH v2 2/2] ASoC: codecs: Add Richtek rtq9128audio amplifier support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 19, 2023 at 08:42:29AM -0400, Pierre-Louis Bossart wrote:
> 
> > +static int rtq9128_i2c_write(void *context, const void *data, size_t count)
> > +{
> > +	struct device *dev = context;
> > +	struct i2c_client *i2c = to_i2c_client(dev);
> > +	u8 reg = *(u8 *)data;
> > +	int rg_size;
> > +
> > +	BUG_ON(count != 5);
> 
> is this really necessary? Just log and error and return?
> same comments for other functions
>
Yap, it can be removed. Originally, just use it to check regmap core really
follow the declared regmap config.

I think this check may still needed. I'll change the BUG_ON to if/err/return
following by your suggestion in v3.
> > +	rg_size = rtq9128_get_reg_size(reg);
> > +	return i2c_smbus_write_i2c_block_data(i2c, reg, rg_size, data + count - rg_size);
> > +}
> 



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux