From 84088ebd14aebf1b8499409a037094b9b88e2796 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 7 Oct 2013 12:50:00 +0100 Subject: iio: Add a helper to free a list of IIO device attributes We have the same code to free a IIO device attribute list in multiple place. This patch adds a new helper function to take care of this and replaces the custom instances with a call to the helper function. Note that we do not need to call list_del() for each of the list items since we will never look at any of the list items nor the list itself again. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- drivers/iio/iio_core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/iio/iio_core.h') diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h index 7512cf7..9939917 100644 --- a/drivers/iio/iio_core.h +++ b/drivers/iio/iio_core.h @@ -33,6 +33,7 @@ int __iio_add_chan_devattr(const char *postfix, enum iio_shared_by shared_by, struct device *dev, struct list_head *attr_list); +void iio_free_chan_devattr_list(struct list_head *attr_list); /* Event interface flags */ #define IIO_BUSY_BIT_POS 1 -- cgit v1.1