lkml.org 
[lkml]   [2014]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 REBASED 06/10] serial/arc: remove last remanants of platform data
On Tue, Jun 24, 2014 at 11:38 PM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
> On Wednesday 25 June 2014 02:31 AM, Rob Herring wrote:
>> On Tue, Jun 24, 2014 at 3:25 AM, Vineet Gupta
>> <Vineet.Gupta1@synopsys.com> wrote:
>>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>>> ---
>>> drivers/tty/serial/arc_uart.c | 22 ++++++----------------
>>> 1 file changed, 6 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
>>> index 2ffaf099691a..dc3d5db37dc4 100644
>>> --- a/drivers/tty/serial/arc_uart.c
>>> +++ b/drivers/tty/serial/arc_uart.c
>>
>>> @@ -518,21 +516,13 @@ arc_uart_init_one(struct platform_device *pdev, int dev_id)
>>> }
>>> uart->baud = val;
>>>
>>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> - if (!res)
>>> - return -ENODEV;
>>> -
>>> - res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>> - if (!res2)
>>> - return -ENODEV;
>>> -
>>> - port->mapbase = res->start;
>>> - port->membase = ioremap_nocache(res->start, resource_size(res));
>>> + port->membase = of_iomap(np, 0);
>> ioremap is preferred over of_iomap as it is not OF specific.
>
> I could, but much of the driver assumes OF to be selected already (of_property...)
>
>> Perhaps
>> use devm_request_and_ioremap instead.
>
> devm_request_and_ioremap has been flag day removed in favour of
> devm_ioremap_resource().
> However even then it would require me to retain the prior platform_get_resource()
> call.
> IMHO, of_iomap is must more concise.

Perhaps, but it is preferred to limit the OF specific parts of
drivers. It is maybe not important for this driver, but in cases where
there is a need to support multiple bindings such as DT and ACPI it is
important.

>>> if (!port->membase)
>>> /* No point of dev_err since UART itself is hosed here */
>>> return -ENXIO;
>>>
>>> - port->irq = res2->start;
>>> + port->irq = irq_of_parse_and_map(np, 0);
>>> +
>> platform_get_irq should be used here.
>
> And this again is for reducing OF dependency or is it something else.

We may eventually stop populating the irqs in resources for DT. The
irqs are now translated at probe time to deal with probe ordering
issues.

Rob


\
 
 \ /
  Last update: 2014-07-05 23:41    [W:0.047 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site