From 59a57f6b9ea53f0ff73ec4eafbab23f2dea7221e Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 11 Aug 2008 03:39:09 +0200 Subject: v4l2-dev: video_get/set_drvdata needs to use class_get/set_devdata for < 2.6.19 From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- linux/include/media/v4l2-dev.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux/include/media') diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index 8252d36ec..ba05b8164 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -100,12 +100,20 @@ void video_device_release_empty(struct video_device *vfd); /* helper functions to access driver private data. */ static inline void *video_get_drvdata(struct video_device *dev) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) + return class_get_devdata(&dev->dev); +#else return dev_get_drvdata(&dev->dev); +#endif } static inline void video_set_drvdata(struct video_device *dev, void *data) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) + class_set_devdata(&dev->dev, data); +#else dev_set_drvdata(&dev->dev, data); +#endif } struct video_device *video_devdata(struct file *file); -- cgit v1.2.3