]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iio: light apds9960: Add the missing dev.parent
authorYong Li <sdliyong@gmail.com>
Thu, 5 May 2016 08:10:49 +0000 (16:10 +0800)
committerJonathan Cameron <jic23@kernel.org>
Fri, 3 Jun 2016 11:54:51 +0000 (12:54 +0100)
Without this, the iio:deviceX is missing in the /sys/bus/i2c/devices/0-0039
Some userspace tools use this path to identify a specific instance of the
device.

Signed-off-by: Yong Li <sdliyong@gmail.com>
Reviewed-By: Matt Ranostay <mranostay@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/apds9960.c

index b4dbb39129773467dad31c97eedeb33482a31ecf..651d57b8abbf910b3e94ad9e628e312b958cbb50 100644 (file)
@@ -1011,6 +1011,7 @@ static int apds9960_probe(struct i2c_client *client,
 
        iio_device_attach_buffer(indio_dev, buffer);
 
+       indio_dev->dev.parent = &client->dev;
        indio_dev->info = &apds9960_info;
        indio_dev->name = APDS9960_DRV_NAME;
        indio_dev->channels = apds9960_channels;