long m)
{
int ret;
- struct ad7887_state *st = dev_info->dev_data;
+ struct ad7887_state *st = iio_priv(dev_info);
unsigned int scale_uv;
switch (m) {
/* Estabilish that the iio_dev is a child of the spi device */
indio_dev->dev.parent = &spi->dev;
indio_dev->name = spi_get_device_id(spi)->name;
- indio_dev->dev_data = (void *)(st);
indio_dev->info = &ad7887_info;
indio_dev->modes = INDIO_DIRECT_MODE;
**/
static int ad7887_ring_preenable(struct iio_dev *indio_dev)
{
- struct ad7887_state *st = indio_dev->dev_data;
+ struct ad7887_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
st->d_size = ring->scan_count *
static int ad7887_ring_postdisable(struct iio_dev *indio_dev)
{
- struct ad7887_state *st = indio_dev->dev_data;
+ struct ad7887_state *st = iio_priv(indio_dev);
/* dummy read: restore default CH0 settin */
return spi_sync(st->spi, &st->msg[AD7887_CH0]);
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->private_data;
- struct ad7887_state *st = iio_dev_get_devdata(indio_dev);
+ struct ad7887_state *st = iio_priv(indio_dev);
struct iio_ring_buffer *ring = indio_dev->ring;
s64 time_ns;
__u8 *buf;