iio: adc: ti_am335x_adc: alloc channels via devm_kcalloc()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 28 Apr 2020 11:14:28 +0000 (14:14 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 7 Jul 2020 19:24:11 +0000 (20:24 +0100)
commit6ff0199a1df2f65d708a36aed944c3c11ba198f6
tree936bff4fa20418a648fa0c0b3fc85a4bbcae153f
parenta07a4fe5ff460e99293c0d682421920d54e31d7f
iio: adc: ti_am335x_adc: alloc channels via devm_kcalloc()

This change attaches the life-cycle of the channels array to the parent
device object that is attached to the IIO device.
This way we can remove from the cleanup code, the explicit
tiadc_channels_remove() which simply does a kfree() on the channels array.

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