Re: [PATCH] iio: accel: Add driver for the mCube MC3230 3-axis accelerometer

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

 



> > > +static const struct iio_chan_spec mc3230_channels[] = {
> > > +	MC3230_CHANNEL(MC3230_REG_XOUT, X),
> > > +	MC3230_CHANNEL(MC3230_REG_YOUT, Y),
> > > +	MC3230_CHANNEL(MC3230_REG_ZOUT, Z),
> > > +};
> > > +
> > > +struct mc3230_data {
> > > +	struct i2c_client *client;
> > > +};

probably don't need mc3230_data (or the client pointer within), not worth 
changing as likely stuff will be added in the future

> > > +static int mc3230_set_opcon(struct mc3230_data *data, int opcon)
> > > +{
> > > +	int ret;
> > > +	struct i2c_client *client = data->client;
> > > +
> > 
> > guess we want locking here
> 
> This register only gets touched by this function, and this
> function only gets called:
> 
> -pre iio_device_register
> -post iio_device_unregister
> -on suspend/resume

> So I do not see what it could race with.

I didn't check where set_opcon() is actually called, seems safe

I think there is a theoretic race in _remove() as _unregister() retval is 
not checked, no need to change

p.

-- 

Peter Meerwald-Stadler
+43-664-2444418 (mobile)
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux