Hi Kevin,
On Thu, 28 Jan 2010, Kevin Hilman wrote:
> Hmm, not sure I follow...
>
> struct omap_device already contains a struct platform_device, which in
> turn contains a struct device, so to get an omap_device from a struct
> device, there are two container of operaions: to_platform_device() and
> to_omap_device()
>
>
> from omap_device.h:
>
> struct omap_device {
> u32 magic;
> struct platform_device pdev;
> [...]
> }
> #define to_omap_device(x) container_of((x), struct omap_device, pdev)
>
> from platform_device.h:
> struct platform_device {
> const char * name;
> int id;
> struct device dev;
> [...]
> }
> #define to_platform_device(x) container_of((x), struct platform_device, dev)
Sorry - my E-mail was too hasty and unclear. What I had in mind was the
lifecycle aspect of omap_device - i.e., ensuring that omap_devices are
automatically freed by the device core, similar to the way that
platform_device_alloc() does it.
- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html