ARM: shmobile: Fix device node reference leakage in shmobile_init_delay
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 21 May 2014 13:31:05 +0000 (15:31 +0200)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 4 Feb 2015 10:15:47 +0000 (11:15 +0100)
commitdf7383b75ef123f7aa1c9eeddd5a0c0064612efe
tree0dbc5208c3d8998b4083ef075b84d8cbd3cba315
parent0aa3d6df25d743b610d9cfb05a1612b30e335150
ARM: shmobile: Fix device node reference leakage in shmobile_init_delay

The of_find_compatible_node() function returns a new reference to the
found node. Instead of just adding of_node_put() calls, simplify the
code by moving the CPU identification logic inside the loop over cpu
nodes, in order to lower complexity from O(n) to O(1) by replacing
of_find_compatible_node() calls with of_device_is_compatible().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit edc8fb1d6ebdfc4efa009073586d3567c3368475)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/timer.c