diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 13:42:37 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 23:15:05 (GMT) |
commit | 6fe8135fccd66aedcc55ded70824342587fd2499 (patch) | |
tree | 3afc7acfd0edc052ba93241761e935af9a3b6ebc /drivers/staging/iio/magnetometer | |
parent | a3f02370c9fa6d85fbee2c11649ebc9c84bae919 (diff) | |
download | linux-6fe8135fccd66aedcc55ded70824342587fd2499.tar.xz |
staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
This was suggested by Arnd Bergmann, Other elements may well
move in here in future, but it definitely makes sense for these.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/magnetometer')
-rw-r--r-- | drivers/staging/iio/magnetometer/ak8975.c | 8 | ||||
-rw-r--r-- | drivers/staging/iio/magnetometer/hmc5843.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index 2226b88..700f96c 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c @@ -474,6 +474,11 @@ static struct attribute_group ak8975_attr_group = { .attrs = ak8975_attr, }; +static const struct iio_info ak8975_info = { + .attrs = &ak8975_attr_group, + .driver_module = THIS_MODULE, +}; + static int ak8975_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -533,9 +538,8 @@ static int ak8975_probe(struct i2c_client *client, } data->indio_dev->dev.parent = &client->dev; - data->indio_dev->attrs = &ak8975_attr_group; + data->indio_dev->info = &ak8975_info; 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); diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index d0676e9..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) { @@ -557,10 +562,9 @@ static int hmc5843_probe(struct i2c_client *client, 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) |