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

index be2de48844bc539b18f6fd29eb6f31f0952174a2..2df84fa5e3fcd3d9fd89de1790979fbdd1633435 100644 (file)
@@ -318,6 +318,7 @@ static int stx104_probe(struct device *dev, unsigned int id)
        }
 
        indio_dev->name = dev_name(dev);
+       indio_dev->dev.parent = dev;
 
        priv = iio_priv(indio_dev);
        priv->base = base[id];