forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: pressure: st_pressure: use devm_iio_triggered_buffer_setup() for…
… buffer The st_press_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_press_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_press_allocate_ring() as well. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
- Loading branch information
Showing
3 changed files
with
3 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,13 +41,8 @@ static const struct iio_buffer_setup_ops st_press_buffer_setup_ops = { | |
|
||
int st_press_allocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
return iio_triggered_buffer_setup(indio_dev, NULL, | ||
&st_sensors_trigger_handler, &st_press_buffer_setup_ops); | ||
} | ||
|
||
void st_press_deallocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
iio_triggered_buffer_cleanup(indio_dev); | ||
return devm_iio_triggered_buffer_setup(indio_dev->dev.parent, indio_dev, | ||
NULL, &st_sensors_trigger_handler, &st_press_buffer_setup_ops); | ||
} | ||
|
||
MODULE_AUTHOR("Denis Ciocca <[email protected]>"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters