iio: max30100: Set parent device
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Feb 2017 12:34:17 +0000 (13:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 11:59:36 +0000 (11:59 +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/max30100.c

index 9648c69ea1a2062b9297d8fd8c6701d88a08c3e4..10b3e0d57c4acbdcda2555c10fcca6f2947c3477 100644 (file)
@@ -449,6 +449,7 @@ static int max30100_probe(struct i2c_client *client,
        indio_dev->available_scan_masks = max30100_scan_masks;
        indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE);
        indio_dev->setup_ops = &max30100_buffer_setup_ops;
+       indio_dev->dev.parent = &client->dev;
 
        data = iio_priv(indio_dev);
        data->indio_dev = indio_dev;