]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iio: maxim_thermocouple: Set parent device
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Feb 2017 12:34:21 +0000 (13:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 12:03:33 +0000 (12:03 +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/temperature/maxim_thermocouple.c

index f962f31a5eb223c4f41d273743ed75f30e648a18..557214202eff35dd870ea085a81161de2982c147 100644 (file)
@@ -231,6 +231,7 @@ static int maxim_thermocouple_probe(struct spi_device *spi)
        indio_dev->available_scan_masks = chip->scan_masks;
        indio_dev->num_channels = chip->num_channels;
        indio_dev->modes = INDIO_DIRECT_MODE;
+       indio_dev->dev.parent = &spi->dev;
 
        data = iio_priv(indio_dev);
        data->spi = spi;