On 9 May 2012 18:55, Mark Brown <broo...@opensource.wolfsonmicro.com> wrote:
> On Wed, May 09, 2012 at 11:10:14AM +0200, Heiko Stübner wrote:
>
>> Similar to the adc and rtc driver, all Samsung platforms reuse a common
>> platform-device definition for the s3c64xx-spi and simply will set the 
>> correct
>> name when the machine type is determined during boot.
>
> Right, that doesn't mean this is a great way of doing things, though -
> it's been a frequent source of errors in the past and is painful to
> debug as the data structures get rewritten during boot which is a bit of
> a surprise.
>
>> The alternative is creating a mulitude of platform devices for each possible
>> machine type using this driver.
>
> Yes, that's the normal way of handling this and is actually what the
> code was originally doing - there's a bunch of ifdefed devices in
> plat-samsung/devs.c.  You usually have to do this anyway as the IPs move
> about so the resources need changing.

In addition to the setting the name, the platform data is also
assigned at runtime. Adding multiple platform devices means that we
add lot more code in setting up the platform data. And since we are
moving towards adopting dt, these would anyway go away when we have
all the platforms migrated to dt.

Thanks,
Thomas.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to