lkml.org 
[lkml]   [2013]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] timer: vt8500: Move system timer to clocksource
Date
On Thursday 03 January 2013, Joe Perches wrote:
> Also I think it'd be nicer to write something like:
>
> struct device_node *np;
> int timer_irq;
> const char *reason;
>
> np = of_find_matching_node(NULL, vt8500_timer_ids);
> if (!np) {
> reason = "timer";
> goto error;
> }
> regbase = of_iomap(np, 0);
> if (!regbase) {
> reason = "iobase";
> goto error_put;
> }
> timer_irq = irq_of_parse_and_map(np, 0);
> if (!timer_irq) {
> reason = "irq";
> goto error_remap;
> }
>
> ...
>
> error_remap:
> unmap...;
> error_put:
> of_node_put(np);
> error:
> pr_err("%s: Missing %s description in Device Tree\n",
> __func__, reason);
> return;

Right, but that would be a separate cleanup patch, since the patch that
Tony posted is just supposed to move the code around and change as little
else as possible in the process. The cleanup can come either right before
or right after the move.

Arnd


\
 
 \ /
  Last update: 2013-01-03 09:41    [W:0.044 / U:24.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site