From 7a92de92b3433ca26b88389626622854a8a37d62 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 12 May 2012 15:39:32 +0200 Subject: [PATCH] --- yaml --- r: 304665 b: refs/heads/master c: 7a7913f11ddf932e20d2bde72bec57f2f7a9b49e h: refs/heads/master i: 304663: f124ee37ca661a40fa54b1465da0516e62bc31ac 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 86a0427f52f8..90c2e1e7aa02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7086e6e5baae90047ecfb1416082409634868e66 +refs/heads/master: 7a7913f11ddf932e20d2bde72bec57f2f7a9b49e diff --git a/trunk/include/linux/iio/iio.h b/trunk/include/linux/iio/iio.h index 897c6b01d784..3a4f6a3ab80d 100644 --- a/trunk/include/linux/iio/iio.h +++ b/trunk/include/linux/iio/iio.h @@ -427,6 +427,17 @@ static inline void iio_device_put(struct iio_dev *indio_dev) put_device(&indio_dev->dev); }; +/** + * dev_to_iio_dev() - Get IIO device struct from a device struct + * @dev: The device embedded in the IIO device + * + * Note: The device must be a IIO device, otherwise the result is undefined. + */ +static inline struct iio_dev *dev_to_iio_dev(struct device *dev) +{ + return container_of(dev, struct iio_dev, dev); +} + /* Can we make this smaller? */ #define IIO_ALIGN L1_CACHE_BYTES /**