[PATCH v2 4/6] ARM: Samsung: Modify s3c64xx_spi{0|1|2}_set_platdata function
Thomas Abraham
thomas.abraham at linaro.org
Sun Jun 3 19:29:50 EST 2012
On 1 June 2012 18:09, Mark Brown <broonie at opensource.wolfsonmicro.com> wrote:
> On Fri, Jun 01, 2012 at 10:47:44AM +0800, Thomas Abraham wrote:
>
>> 1. There is one instance of 'struct platform_device' for each of the
>> spi controller instances (0/1/2) named "s3c64xx-spi" (in
>> arch/arm/plat-samsung/devs.c).
>
> Right, which looks rather like it is specific to s3c64xx at least given
> the naming... there aren't any current in tree users, though I do have
> one out of tree user on s3c6410. If this is supposed to be used on the
> later SoCs too then I guess it ought to be renamed anyway since what's
> there looks wrong.
The spi platform device is not really s3c64xx specific. It can be
reused on all other Samsung SoC's as well, but there are no users of
this except for s3c64xx SoC. The resources for this platform devices
are statically bound for a SoC during compile time. I would not
consider the existing spi platform device instance name
(s3c64xx_device_spi0) or the .name (s3c64xx-spi) to be factor in
reusing it on other Samsung SoC's.
>
>> 5. If point 4 is not correct, the other option is to create a separate
>> instances of 'struct platform_device' for each of the s3c, s5p and
>> Exynos4/5 SoC's. Is this the correct way, and if yes, could you please
>> help me understand the issues in setting the name of the platform
>> device at runtime.
>
> That would seem less painful to me. The big problem I've found is with
> things like matching clocks up where if you look at the device that's
> being registered it has one name but at runtime it has another name, it
> makes everything much harder to follow. There was one of the devices
> where the .id also ended up getting changed which created even more
> confusion.
Yes, I agree with you that changing device names at runtime can be
confusing at times. Probably, additional comments to indicate possible
runtime changes in device names could be useful.
For now, I will avoid runtime setting of platform device name as you
have suggested. Thank your for providing clarification for my
questions.
Regards,
Thomas.
More information about the devicetree-discuss
mailing list