iio: hid-sensors: bind IIO channels alloc to device object
authorAlexandru Ardelean <aardelean@deviqon.com>
Wed, 30 Jun 2021 12:30:29 +0000 (15:30 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 13 Jul 2021 17:21:53 +0000 (18:21 +0100)
commit8b2ac51625ac96afd488d3ddd90c95c3417eb736
tree37a4d0b6aba90983b8dd6346140bf41ab3f4755d
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
iio: hid-sensors: bind IIO channels alloc to device object

Some HID drivers use devm_kmemdup() already to clone the template IIO
channels information and update it.
However, there are still some drivers that kmemdup() and kfree() the
channels.

This change converts them to use devm_kmemdup() and bind the life-time of
this allocated object to the parent device object (in these drivers).

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20210630123029.759609-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/gyro/hid-sensor-gyro-3d.c
drivers/iio/light/hid-sensor-als.c
drivers/iio/light/hid-sensor-prox.c
drivers/iio/orientation/hid-sensor-incl-3d.c
drivers/iio/pressure/hid-sensor-press.c