From: Grant Likely <grant.likely@secretlab.ca>
To: Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org, kay.sievers@vrfy.org
Subject: Re: [RFC] drivercore: Add of_match_table to the common device drivers
Date: Sun, 7 Mar 2010 13:33:27 -0700 [thread overview]
Message-ID: <fa686aa41003071233t686969f3y533a2c5a6b952b27@mail.gmail.com> (raw)
In-Reply-To: <20100307180534.GA3604@suse.de>
On Sun, Mar 7, 2010 at 11:05 AM, Greg KH <gregkh@suse.de> wrote:
> On Sat, Mar 06, 2010 at 11:47:00PM -0700, Grant Likely wrote:
>> OF-style matching can be available to any device, on any type of bus.
>> This patch allows any driver to provide an OF match table when CONFIG_OF
>> is enabled so that drivers can be bound against devices described in
>> the device tree.
>>
>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>> ---
>>
>> Hi Greg and Kay,
>>
>> Here is a potentially even more controversial RFC patch, the relevant
>> chunk being the addition of an of-style match table to struct device_driver
>> when CONFIG_OF is set. The idea being that OF style device binding is
>> applicable on any bus, regardless of the bus type. Each bus' probe could
>> be trivially extended to allow for an OF-style probe match.
>>
>> I've used a #ifdef in this version, but it doesn't have to be conditional
>> if that would make for cleaner code. Either way, none of the core code
>> would need to have and #ifdef bits.
>>
>> As with the previous patch, I want to get feedback before I proceed too
>> far down this path.
>
> I have no objection to this patch at all, it looks good to me.
>
> Perhaps, in the future, you might be able to move the OF driver/device
> binding into the driver core itself to make it easier in the end. But
> for now, feel free to add:
> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
> and send it off through your tree.
Thanks Greg.
Yes, I seem to be moving in that direction. The OF api's are turning
out to be quite complementary to the rest of the driver model. If
CONFIG_OF is enabled, then a whole bunch of routines become available
to drivers for fetching data as an alternative to pdata. If not, then
the OF apis become empty inline stubs that return invalid or error
codes. The nice thing is that the apis all work the same, regardless
of the underlying bus interface, so it is usable by more than just the
platform & of_platform busses.
I've got a metric truckload of patches to post that go in this
direction, but I'm waiting until after the merge window so I don't add
to the normal bedlam. :-)
Cheers,
g.
---
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
prev parent reply other threads:[~2010-03-07 20:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-07 6:47 [RFC] drivercore: Add of_match_table to the common device drivers Grant Likely
2010-03-07 7:07 ` Stephen Rothwell
[not found] ` <20100307180744.956998c5.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2010-03-07 7:19 ` Grant Likely
2010-03-07 18:05 ` Greg KH
2010-03-07 20:33 ` Grant Likely [this message]
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=fa686aa41003071233t686969f3y533a2c5a6b952b27@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=gregkh@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
/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