瀏覽代碼

iio: maxim_thermocouple: Set parent device

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>
Lars-Peter Clausen 8 年之前
父節點
當前提交
74e2419b00
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/iio/temperature/maxim_thermocouple.c

+ 1 - 0
drivers/iio/temperature/maxim_thermocouple.c

@@ -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;