]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iio: max31856: add missing of_node and parent references to iio_dev
authorAndrea Merello <andrea.merello@gmail.com>
Mon, 9 Sep 2019 12:58:17 +0000 (14:58 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Sep 2019 12:26:06 +0000 (13:26 +0100)
Adding missing indio_dev->dev.of_node references so that, in case multiple
max31856 are present, users can get some clues to being able to distinguish
each of them. While at it, add also the missing parent reference.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/max31856.c

index f184ba5601d94beaeca2b149ff146968ed4eef6f..73ed550e3fc95ece760fcbc65828d7d439634efe 100644 (file)
@@ -284,6 +284,8 @@ static int max31856_probe(struct spi_device *spi)
        spi_set_drvdata(spi, indio_dev);
 
        indio_dev->info = &max31856_info;
+       indio_dev->dev.parent = &spi->dev;
+       indio_dev->dev.of_node = spi->dev.of_node;
        indio_dev->name = id->name;
        indio_dev->modes = INDIO_DIRECT_MODE;
        indio_dev->channels = max31856_channels;