Hi Jonathan, On Monday 11 October 2010 00:23:13 Jonathan Corbet wrote: > Howdy, all, > > Well, that took a whole lot longer than I had hoped...but, attached, is a > new version of the viafb camera driver patch, done against 2.6.36-rc7. > I've tried to address most of Laurent's comments from back in June; in > particular, I have: > > - Gotten rid of the static device structure Thanks. There's one more left, and it's easy to remove, see below. > - Fixed some locking glitches > - Fixed a bit of device initialization silliness. > > One thing I have *not* done is to push locking down into the ov7670 > driver. That would be a good thing to do at some point, but playing with > that driver was beyond the scope of what I was trying to do here. > > This driver will still need some OLPC bits to work properly, but Daniel is > working on that. This version of the driver does work on XO-1.5 systems, > modulo some 2.6.36 API changes. [snip] > +/* > + * Yes, this is a hack, but there's only going to be one of these > + * on any system we know of. > + */ > +static struct via_camera *via_cam_info; That's what I'm talking about. [snip] > +static __devinit int viacam_probe(struct platform_device *pdev) > +{ [snip] > + /* > + * Basic structure initialization. > + */ > + cam = kzalloc (sizeof(struct via_camera), GFP_KERNEL); > + if (cam == NULL) > + return -ENOMEM; > + via_cam_info = cam; You set it here. [snip] > +static __devexit int viacam_remove(struct platform_device *pdev) > +{ > + struct via_camera *cam = via_cam_info; And use it here. Just call platform_set_drvdata(pdev, cam) in viacam_probe to store the struct via_camera pointer in the platform device, and platform_get_drvdata(pdev) here to retrieve it. -- Regards, Laurent Pinchart -- 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