[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4E95B3AA.9040603@atmel.com>
Date: Wed, 12 Oct 2011 17:35:06 +0200
From: Nicolas Ferre <nicolas.ferre@...el.com>
To: Grant Likely <grant.likely@...retlab.ca>
CC: Rob Herring <robherring2@...il.com>,
linux-arm-kernel@...ts.infradead.org, alan@...ux.intel.com,
linux-serial@...r.kernel.org, devicetree-discuss@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] tty/serial: atmel_serial: add device tree support
On 10/04/2011 06:52 PM, Grant Likely :
> On Mon, Oct 03, 2011 at 08:58:48PM -0500, Rob Herring wrote:
>> On 10/03/2011 04:51 AM, Nicolas Ferre wrote:
>>> static int __devinit atmel_serial_probe(struct platform_device *pdev)
>>> {
>>> struct atmel_uart_port *port;
>>> + struct device_node *np = pdev->dev.of_node;
>>> struct atmel_uart_data *pdata = pdev->dev.platform_data;
>>> void *data;
>>> int ret;
>>>
>>> BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
>>>
>>> - port = &atmel_ports[pdata->num];
>>> + if (np) {
>>> + ret = of_alias_get_id(np, "serial");
>>> + if (ret < 0)
>>> + goto err;
>>
>> I'll defer to Grant on this. There aren't any other drivers using this.
>>
>
> This is the correct thing to do.
>
> One note however; I prefer driver to *not* require an alias to be
> present. By all means, use an alias if it is available, but the
> driver should auto-enumerate if it is not. There is a patch that
> makes of_alias_get_id() do this for you, but it hasn't been mainlined
> yet and it is still a bit in flux. There will be something that takes
> care of this for you, but be aware that the function name may change.
>
> In the mean time, this patch is okay.
>
> Acked-by: Grant Likely <grant.likely@...retlab.ca>
Grant,
I have reworked this atmel_serial device tree support so I did not add
your "Acked-by" to this new series. I repost it right now.
I hope this new implementation will be even better though ;-)
Bye,
--
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists