From 25ef8d894e9f34e9dad9b021ba9d707f9a94dee2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 4 Jun 2012 10:50:02 +0200 Subject: [PATCH] --- yaml --- r: 317191 b: refs/heads/master c: e4e8b7765867e8f4705bcc18b8930edbe0e4ef3c h: refs/heads/master i: 317189: 28390cedfdd50f0612c0ef96b99ae992ac764af0 317187: 5154a367c29b7cf755d7406955e9178b53883ffb 317183: 4374de88e8e9ed0c0a788299710a2b6214caebad v: v3 --- [refs] | 2 +- trunk/include/linux/iio/iio.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a9e41ac92a84..c1847bbae9bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44dd5b02530a5aaea16c1a0a9eea377407445b4a +refs/heads/master: e4e8b7765867e8f4705bcc18b8930edbe0e4ef3c diff --git a/trunk/include/linux/iio/iio.h b/trunk/include/linux/iio/iio.h index 3a4f6a3ab80d..3238fa3374f7 100644 --- a/trunk/include/linux/iio/iio.h +++ b/trunk/include/linux/iio/iio.h @@ -438,6 +438,17 @@ static inline struct iio_dev *dev_to_iio_dev(struct device *dev) return container_of(dev, struct iio_dev, dev); } +/** + * iio_device_get() - increment reference count for the device + * @indio_dev: IIO device structure + * + * Returns: The passed IIO device + **/ +static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev) +{ + return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; +} + /* Can we make this smaller? */ #define IIO_ALIGN L1_CACHE_BYTES /**