On Sun, Nov 20, 2011 at 08:24:29AM +0100, Jean-Francois Moine wrote: > > Hi Ezequiel, > > It is not a minor patch, but maybe you don't know about object > programming. > > As it is defined, a gspca device _is_ a video device, as a gspca > subdriver is a gspca device, and as a video device is a device: each > lower structure is contained in a higher one. > > Your patch defines the gspca structure as a separate entity which is > somewhat related to a video device by two reverse pointers. It > complexifies the structure accesses, adds more code and hides the > nature of a gspca device. > Hi Jef, Thanks for the explanation, I have things much clear now. I didn't realize linux coding style enforces so explicitly OOP. I based my patch on tm6000 driver and your previous mail about the -supposedly- ugly cast: gspca_dev = (struct gspca_dev *) video_devdata(file); Now it doesn't seems so ugly, I guess I went too far. Still, maybe the 'container_of' trick could make thins easier to understand. Thanks again for your patience, Ezequiel. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html