[PATCH V2 6/6] spi/spi-pl022: Request/free DMA channels as and when required.

Linus Walleij linus.walleij at linaro.org
Thu Aug 11 10:48:54 EDT 2011


2011/8/11 Jassi Brar <jassisinghbrar at gmail.com>:

> Do you have any reason for using device pointer and strings, other
> than just "because clock and regulator use them" ??

Basically no.

But I think these frameworks are very workable and proven
to work in practice. So I like them.

When setting up the platform the coder would to be aware
that there are totally orthogonal concepts, which IMO
makes things complicated.

>>> Do you propose to implement a string parser in the core ?!
>>
>> Yes, the clock and regulator framework already does that.
>> But it is only used when you cannot pass in a struct device *
>> directly, like from device tree.
>
> Dude, I have utter disrespect for using strings in a case such as
> expressing requirements.

It's mainly a strcmp(), and it's only comparing to the
well-established namespace that all devices have anyway,
due to the way the device model is done.

Basically when binding clocks or regulators it's:

struct device *dev;
strcmp(map_string, dev_name(dev));

By this time struct device exist of course, since
it's the device driver calling to get its clock/regulator.

dev_name() comes from <linux/device.h> and basically
takes the kobject name or an optional initilizer name
for the device. So the names are pretty static, you don't
need to parse them, just compare.

> I have already explained how we can easily and in a _better_ way
> do without them (again see my last reply to Vindo's setup).
> Tell me 1 reason why using strings, in this case, would be better ?

I have no other reasons than the above.

People like Russell (clkdevice) and Liam Girdwood (regulator)
who I know are smarter than me and have worked with
these subsystems for years choose that model, so I trust
their judgement.

Thanks,
Linus Walleij



More information about the linux-arm-kernel mailing list