diff options
Diffstat (limited to 'drivers/iio/light/vl6180.c')
-rw-r--r-- | drivers/iio/light/vl6180.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/light/vl6180.c b/drivers/iio/light/vl6180.c index d9533a76b8f6..d47a4f6f4e87 100644 --- a/drivers/iio/light/vl6180.c +++ b/drivers/iio/light/vl6180.c @@ -16,6 +16,7 @@ */ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/mutex.h> #include <linux/err.h> @@ -391,7 +392,7 @@ static int vl6180_set_it(struct vl6180_data *data, int val, int val2) { int ret, it_ms; - it_ms = (val2 + 500) / 1000; /* round to ms */ + it_ms = DIV_ROUND_CLOSEST(val2, 1000); /* round to ms */ if (val != 0 || it_ms < 1 || it_ms > 512) return -EINVAL; @@ -508,7 +509,6 @@ static int vl6180_probe(struct i2c_client *client, data->client = client; mutex_init(&data->lock); - indio_dev->dev.parent = &client->dev; indio_dev->info = &vl6180_info; indio_dev->channels = vl6180_channels; indio_dev->num_channels = ARRAY_SIZE(vl6180_channels); @@ -537,7 +537,7 @@ MODULE_DEVICE_TABLE(i2c, vl6180_id); static struct i2c_driver vl6180_driver = { .driver = { .name = VL6180_DRV_NAME, - .of_match_table = of_match_ptr(vl6180_of_match), + .of_match_table = vl6180_of_match, }, .probe = vl6180_probe, .id_table = vl6180_id, |