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 /**