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

Linus Torvalds <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.comp.video.video4linux,gmane.linux.kernel
Message-ID <[email protected]>

On Fri, 14 Sep 2007, Luca Risolia wrote:

> Hacked-by: Luca Risolia <[email protected]>
> 
> On Friday 14 September 2007 00:27:17 Andreas Herrmann wrote:
> > This fixes a kernel build problem and
> > should make it into 2.6.23, I think.
> >
> >
> > Regards,
> >
> > Andreas
> >
> > --
> >
> > Get rid of some v4l1 remainders to avoid kernel build errors if
> > V4L1_COMPAT is not selected:
> >
> >   drivers/media/video/et61x251/et61x251_core.c: In et61x251_show_:
> >   drivers/media/video/et61x251/et61x251_core.c:718: error: implicit
> >     declaration of to_video_device
> >
> > Fix as suggested by  Luca Risolia <[email protected]>

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)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.