From: Grant Likely <grant.likely@secretlab.ca>
To: Sean MacLennan <smaclennan@pikatech.com>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE
Date: Wed, 27 May 2009 23:09:05 -0600 [thread overview]
Message-ID: <fa686aa40905272209p61c4a4b9ofa29c0de15d9efa1@mail.gmail.com> (raw)
In-Reply-To: <20090528010000.31423083@lappy.seanm.ca>
On Wed, May 27, 2009 at 11:00 PM, Sean MacLennan
<smaclennan@pikatech.com> wrote:
> On Wed, 27 May 2009 21:42:18 -0600
> Grant Likely <grant.likely@secretlab.ca> wrote:
>
>> 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.
next prev parent reply other threads:[~2009-05-28 5:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 16:50 powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE Albert Herranz
2009-05-24 6:47 ` Grant Likely
2009-05-24 10:21 ` Benjamin Herrenschmidt
2009-05-25 0:21 ` Benjamin Herrenschmidt
2009-05-25 1:43 ` Arnd Bergmann
2009-05-25 4:19 ` Benjamin Herrenschmidt
2009-05-25 4:33 ` Benjamin Herrenschmidt
2009-05-25 5:50 ` Grant Likely
2009-05-25 6:49 ` Benjamin Herrenschmidt
2009-05-28 3:34 ` Sean MacLennan
2009-05-28 3:42 ` Grant Likely
2009-05-28 5:00 ` Sean MacLennan
2009-05-28 5:09 ` Grant Likely [this message]
2009-05-28 3:52 ` Benjamin Herrenschmidt
2009-05-28 4:11 ` Sean MacLennan
2009-05-28 4:19 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2009-05-26 17:13 Albert Herranz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa686aa40905272209p61c4a4b9ofa29c0de15d9efa1@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.org \
--cc=smaclennan@pikatech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).