]> git.baikalelectronics.ru Git - kernel.git/commit
iio: light: lm3533-als: use iio_device_set_parent() to assign parent
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 3 Jun 2020 11:40:22 +0000 (14:40 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:50:02 +0000 (11:50 +0100)
commite0ecd364b893f5fa27568ad7ab7c96017b32552a
tree45061bca03ed6314d6584c7789a408a242949aca
parent68208fd1c9643452c316520b0e1a260d3b429fee
iio: light: lm3533-als: use iio_device_set_parent() to assign parent

This assignment is the more peculiar as it assigns the parent of the
platform-device's device (i.e. pdev->dev.parent) as the IIO device's
parent.

Since the devm_iio_device_alloc() [now] assigns the device argument as the
default parent (and since this is the more common case), for cases
where the parent needs to be different, the iio_device_set_parent helper
should be used.

That makes things a bit more obvious about the new behavior of
devm_iio_device_alloc() and makes it clearer that iio_device_set_parent()
should be used.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/lm3533-als.c