lkml.org 
[lkml]   [2011]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: RFC: Platform data for onboard USB assets
On Fri, Mar 11, 2011 at 3:47 PM, Andy Green <andy@warmcat.com> wrote:
> On 03/11/2011 10:45 PM, Somebody in the thread at some point said:
>>
>> On Fri, Mar 11, 2011 at 2:50 AM, Andy Green<andy@warmcat.com>  wrote:
>>>
>>> Hi -
>>>
>>> platform_data is a well established way in Linux to pass configuration
>>> data
>>> up to on-board assets from a machine file like mach-xyz.c.  It's also
>>> supported to pass platform_data up to devices that are probed
>>> asynchronously
>>> from busses like i2c as well, which is very handy.
>>>
>>> However AFAIK it's not possible to bind platform_data to probed USB
>>> devices
>>> as it stands.
>>
>> Oh, please no.
>>
>> platform_data is an ugly non-type-checked anonymous pointer.  If you
>> need to pass data to a driver, use something better designed.  A
>> device tree fragment would work, or provide some kind of query api.
>> platform_data is definitely the wrong approach.
>
> $ grep platform_data drivers/* -R | wc -l
> 2110

I'm not disputing that it is widely used; and it does make a certain
amount of sense for static device registrations, but it is not a nice
interface, and it is a horrible idea for dynamic devices.

--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-03-12 00:43    [W:0.213 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site