]> git.baikalelectronics.ru Git - kernel.git/commit
iio: stx104: Utilize devm_ functions in driver probe callback
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Tue, 24 Jan 2017 20:26:17 +0000 (15:26 -0500)
committerJonathan Cameron <jic23@kernel.org>
Sat, 28 Jan 2017 12:44:05 +0000 (12:44 +0000)
commit71cdfd2ff66f5e06ebfed978d66d94e9b0576c49
tree6fe5e8c114df4446a71f54f7091dd64f3945ae9a
parentc9ab6b7b88494b55f93608c166c76ff122b3ac63
iio: stx104: Utilize devm_ functions in driver probe callback

The devm_ resource manager functions allow memory to be automatically
released when a device is unbound. This patch takes advantage of the
resource manager functions and replaces the gpiochip_add_data call and
iio_device_register call with the devm_gpiochip_add_data call and
devm_iio_device_register call respectively. In addition, the
stx104_remove function has been removed as no longer necessary due to
the use of the relevant devm_ resource manager functions.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/stx104.c