Thread (16 messages) 16 messages, 5 authors, 2009-05-28

Re: powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE

From: Grant Likely <hidden>
Date: 2009-05-28 05:09:26

On Wed, May 27, 2009 at 11:00 PM, Sean MacLennan
[off-list ref] wrote:
On Wed, 27 May 2009 21:42:18 -0600
Grant Likely [off-list ref] wrote:
quoted
Make your driver use a platform device or an of_platform device. =A0It's
not at all hard.
Here is my first shot.... any other fields that I need to fill in so I
don't have any gotchas?

/* This must exist */
static void warp_device_release(struct device *dev) {}
It will be easier if you do it as an of_device.  Then you just need to
add a node to the device tree and it will get registered correctly
without any platform specific registration code.  That gives your
driver something to bind against.

However, if you do want to do it this way...
static struct platform_device warp_device =3D {
=A0 =A0 =A0 =A0.name =3D "warp-device",
=A0 =A0 =A0 =A0.id =3D 0,
=A0 =A0 =A0 =A0.num_resources =3D 0,
=A0 =A0 =A0 =A0.dev =3D {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.coherent_dma_mask =3D ~0ULL,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.release =3D warp_device_release,
=A0 =A0 =A0 =A0},
};
No need for all this.  use platform_device_register_simple() instead.
Again, that gives your driver something to bind again, this time on
the platform bus (instead of of_platform bus).

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help