浏览代码

iio: quad-8: 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>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Lars-Peter Clausen 8 年之前
父节点
当前提交
ed165e9171
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/iio/counter/104-quad-8.c

+ 1 - 0
drivers/iio/counter/104-quad-8.c

@@ -551,6 +551,7 @@ static int quad8_probe(struct device *dev, unsigned int id)
 	indio_dev->num_channels = ARRAY_SIZE(quad8_channels);
 	indio_dev->num_channels = ARRAY_SIZE(quad8_channels);
 	indio_dev->channels = quad8_channels;
 	indio_dev->channels = quad8_channels;
 	indio_dev->name = dev_name(dev);
 	indio_dev->name = dev_name(dev);
+	indio_dev->dev.parent = dev;
 
 
 	priv = iio_priv(indio_dev);
 	priv = iio_priv(indio_dev);
 	priv->base = base[id];
 	priv->base = base[id];