Re: [PATCH] v4l: fix build error for et61x251 driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Luca Risolia <luca.risolia@...>
Cc: Andreas Herrmann <aherrman@...>, <akpm@...>, <linux-usb-devel@...>, <video4linux-list@...>, <linux-kernel@...>
Date: Thursday, September 13, 2007 - 8:09 pm

On Fri, 14 Sep 2007, Luca Risolia wrote:


This patch is really ugly.

Why can't the "to_video_device()" macro be used? Just move it to a place 
where it's usable! IOW, what's wrong with the *much* simpler patch below?

That "to_video_device()" macro has absolutely _nothing_ to do with 
CONFIG_VIDEO_V4L1_COMPAT, as far as I can tell!

			Linus
---
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index d62847f..17f8f3a 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -337,6 +337,9 @@ void *priv;
 	struct class_device class_dev; /* sysfs */
 };
 
+/* Class-dev to video-device */
+#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
+
 /* Version 2 functions */
 extern int video_register_device(struct video_device *vfd, int type, int nr);
 void video_unregister_device(struct video_device *);
@@ -354,11 +357,9 @@ extern int video_usercopy(struct inode *inode, struct file *file,
 			  int (*func)(struct inode *inode, struct file *file,
 				      unsigned int cmd, void *arg));
 
-
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
 #include <linux/mm.h>
 
-#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
 static inline int __must_check
 video_device_create_file(struct video_device *vfd,
 			 struct class_device_attribute *attr)
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] v4l: fix build error for et61x251 driver, Andreas Herrmann, (Thu Sep 13, 6:27 pm)
Re: [PATCH] v4l: fix build error for et61x251 driver, Luca Risolia, (Thu Sep 13, 6:28 pm)
Re: [PATCH] v4l: fix build error for et61x251 driver, Linus Torvalds, (Thu Sep 13, 8:09 pm)
Re: [PATCH] v4l: fix build error for et61x251 driver, Luca Risolia, (Thu Sep 13, 9:53 pm)
Re: [PATCH] v4l: fix build error for et61x251 driver, Mauro Carvalho Chehab, (Fri Sep 14, 8:50 am)
Re: [PATCH] v4l: fix build error for et61x251 driver, Luca Risolia, (Fri Sep 14, 9:57 am)
Re: [PATCH] v4l: fix build error for et61x251 driver, Mauro Carvalho Chehab, (Fri Sep 14, 11:56 am)