iio: core: Add devm_ APIs for iio_channel_{get,release}_all
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 6 Apr 2016 10:31:07 +0000 (16:01 +0530)
committerJonathan Cameron <jic23@kernel.org>
Tue, 19 Apr 2016 18:58:15 +0000 (19:58 +0100)
commitefc2c0133f198bc65593a67015af358919b0c48f
treea5559eed375f002c6ed912abd05c79e73f4bb7c4
parent8bf872d8d261feefcdf67027522e3f717cad2bfe
iio: core: Add devm_ APIs for iio_channel_{get,release}_all

Some of kernel driver uses the IIO framework to get the sensor
value via ADC or IIO HW driver. The client driver get iio channel
by iio_channel_get_all() and release it by calling
iio_channel_release_all().

Add resource managed version (devm_*) of these APIs so that if client
calls the devm_iio_channel_get_all() then it need not to release it
explicitly, it can be done by managed device framework when driver
get un-binded.

This reduces the code in error path and also need of .remove callback in
some cases.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/inkern.c
include/linux/iio/consumer.h