]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iio: pulsedlight-lidar-lite-v2: Set parent device
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Feb 2017 12:34:20 +0000 (13:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Feb 2017 12:02:31 +0000 (12:02 +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>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

index 20c16a08c9d909c8b6937db21a857911a0c70e91..36c1ddc251aa721e9857e3821dbd2d0aedb27c01 100644 (file)
@@ -278,6 +278,7 @@ static int lidar_probe(struct i2c_client *client,
        indio_dev->name = LIDAR_DRV_NAME;
        indio_dev->channels = lidar_channels;
        indio_dev->num_channels = ARRAY_SIZE(lidar_channels);
+       indio_dev->dev.parent = &client->dev;
        indio_dev->modes = INDIO_DIRECT_MODE;
 
        i2c_set_clientdata(client, indio_dev);