Hi Jonathan, On Monday 11 October 2010 17:30:48 Jonathan Corbet wrote: > On Mon, 11 Oct 2010 14:18:55 +0200 > > Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> wrote: > > > +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. > > Yes, I know...but the fix isn't quite that simple because the platform > data is already used elsewhere. Aren't you mistaking platform_data and platform device drvdata ? platform_{gs}et_drvdata() access the platform_device::device::device_private::driver_data, which is a private pointer reserved for driver-specific information. pdev->dev.platform_data is a private pointer that stores platform-specific data (often configuration data) in the platform device. > What's needed is some sort of "viafb subdevice instance" structure which can > keep all of the pointers together. My plan is to do that, but it will > require via-core changes and I just don't have time for that right now. > > Can I get away with this (it will cause no real-world trouble) with a > promise of a fix in the next month or two? I have some other via-core > stuff (suspend/resume in particular) that I need to do anyway. If the platform device driver data is really used by something else, OK. But don't dare not keeping your promise ;-) -- 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