iio: quad-8: Set parent device
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Feb 2017 12:34:15 +0000 (13:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 11:57:16 +0000 (11:57 +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>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/counter/104-quad-8.c

index a5913e97945eb6b5f26a418a71852fe086e6cd42..e381ca66a92c1cd581d77fdbb921fea729493fc7 100644 (file)
@@ -551,6 +551,7 @@ static int quad8_probe(struct device *dev, unsigned int id)
        indio_dev->num_channels = ARRAY_SIZE(quad8_channels);
        indio_dev->channels = quad8_channels;
        indio_dev->name = dev_name(dev);
+       indio_dev->dev.parent = dev;
 
        priv = iio_priv(indio_dev);
        priv->base = base[id];