Skip to content

Commit 18d5638

Browse files
Jonathan CameronJonathan Cameron
authored andcommitted
iio: make iio_device_get_drvdata take a const struct iio_dev *.
As this just calls dev_get_drvdata underneath which is happy with a const struct device * we should change and avoid potentially casting away a const in order to then put it back again. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent cd64d35 commit 18d5638

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/linux/iio/iio.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
669669
*
670670
* Returns the data previously set with iio_device_set_drvdata()
671671
*/
672-
static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
672+
static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
673673
{
674674
return dev_get_drvdata(&indio_dev->dev);
675675
}

0 commit comments

Comments
 (0)