]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 9 Aug 2016 13:08:44 +0000 (15:08 +0200)
BugLink: http://bugs.launchpad.net/bugs/1607404
commit 590b92a30242dd3f73de3d9a51d9924f1ab33e93 upstream.

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/iio/light/apds9960.c

index f6a07dc32ae486a045b97cfb4406783a9aa05ab8..4a6d9670e4cdc589217aba1c7b6a3ccada7d9196 100644 (file)
@@ -1005,6 +1005,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;