Re: [PATCH v2] tty: ar933x_uart: add device tree support and binding documentation

Gabor Juhos
2013-09-05T07:53:35Z

2013.09.04. 0:16 keltezéssel, Kumar Gala írta:
>
> On Aug 29, 2013, at 4:48 AM, Gabor Juhos wrote:
>
>> Modify the probe routine to get the port line number
>> from device tree if the 'of_node' is populated in the
>> platform device. The driver can be built as module,
>> thus add an OF specific module device table as well
>> to support module auto loading.
>>
>> This makes it possible to use the driver for AR9330
>> UART devices specified in device tree.
>>
>> Cc: devicetree@vger.kernel.org
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> ---
>> Changes since v1:
>> - move the doc from bindings/tty/serial to bindings/serial
>>
>> The patch is agains the 'tty-next' branch of the
>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tree
>> ---
>> .../devicetree/bindings/serial/qca,ar9330-uart.txt | 34 ++++++++++++++++++++
>> drivers/tty/serial/ar933x_uart.c | 28 ++++++++++++++--
>> 2 files changed, 59 insertions(+), 3 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt
>>
>> diff --git a/Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt b/Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt
>> new file mode 100644
>> index 0000000..c5e032c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt
>> @@ -0,0 +1,34 @@
>> +* Qualcomm Atheros AR9330 High-Speed UART
>> +
>> +Required properties:
>> +
>> +- compatible: Must be "qca,ar9330-uart"
>
> If the driver is called ar933x, is there a reason not to do so with the compatible and binding spec?

Yes, there is a reason, the compatible string should not contain wildcards. At
least the devicetree.org wiki [1] says the following:

Warning: Don't use wildcard compatible values, like "fsl,mpc83xx-uart" or
similar. Silicon vendors will invariably make a change that breaks your wildcard
assumptions the moment it is too late to change it. Instead, choose a specific
silicon implementations and make all subsequent silicon compatible with it.

Additionally, Grant Likely wrote the same thing here basically:

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-January/082265.html

-Gabor

1. http://devicetree.org/Device_Tree_Usage#Understanding_the_compatible_Property