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

index 5a743e2a779d93bf6bef457c3217b32fcefcff91..a0464227a3a0dfb9153f8c285332587f8c2c395f 100644 (file)
@@ -119,6 +119,7 @@ static int cio_dac_probe(struct device *dev, unsigned int id)
        indio_dev->channels = cio_dac_channels;
        indio_dev->num_channels = CIO_DAC_NUM_CHAN;
        indio_dev->name = dev_name(dev);
+       indio_dev->dev.parent = dev;
 
        priv = iio_priv(indio_dev);
        priv->base = base[id];