diff options
Diffstat (limited to 'drivers/staging/iio/magnetometer/hmc5843.c')
-rw-r--r-- | drivers/staging/iio/magnetometer/hmc5843.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index 5168917..dd9a3bb 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c @@ -529,6 +529,11 @@ static void hmc5843_init_client(struct i2c_client *client) pr_info("HMC5843 initialized\n"); } +static const struct iio_info hmc5843_info = { + .attrs = &hmc5843_group, + .driver_module = THIS_MODULE, +}; + static int hmc5843_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -552,15 +557,14 @@ static int hmc5843_probe(struct i2c_client *client, /* Initialize the HMC5843 chip */ hmc5843_init_client(client); - data->indio_dev = iio_allocate_device(); + data->indio_dev = iio_allocate_device(0); if (!data->indio_dev) { err = -ENOMEM; goto exit_free1; } - data->indio_dev->attrs = &hmc5843_group; + data->indio_dev->info = &hmc5843_info; data->indio_dev->dev.parent = &client->dev; data->indio_dev->dev_data = (void *)(data); - data->indio_dev->driver_module = THIS_MODULE; data->indio_dev->modes = INDIO_DIRECT_MODE; err = iio_device_register(data->indio_dev); if (err) |