iio: max30102: Set parent device
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Feb 2017 12:34:18 +0000 (13:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 12:00:16 +0000 (12:00 +0000)
Initialize the parent of the IIO device to the device that registered it.
This makes sure that the IIO device appears the right level in the device
hierarchy.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/health/max30102.c

index 377518c15552d661af19185c135876caf56644b9..839b875c29b9d5de4246a7deb98a4b94412a249f 100644 (file)
@@ -410,6 +410,7 @@ static int max30102_probe(struct i2c_client *client,
        indio_dev->available_scan_masks = max30102_scan_masks;
        indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE);
        indio_dev->setup_ops = &max30102_buffer_setup_ops;
+       indio_dev->dev.parent = &client->dev;
 
        data = iio_priv(indio_dev);
        data->indio_dev = indio_dev;