aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/iio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3a4f6a3ab80d..3238fa3374f7 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -438,6 +438,17 @@ static inline struct iio_dev *dev_to_iio_dev(struct device *dev)
438 return container_of(dev, struct iio_dev, dev); 438 return container_of(dev, struct iio_dev, dev);
439} 439}
440 440
441/**
442 * iio_device_get() - increment reference count for the device
443 * @indio_dev: IIO device structure
444 *
445 * Returns: The passed IIO device
446 **/
447static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
448{
449 return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
450}
451
441/* Can we make this smaller? */ 452/* Can we make this smaller? */
442#define IIO_ALIGN L1_CACHE_BYTES 453#define IIO_ALIGN L1_CACHE_BYTES
443/** 454/**