Renesas ARM Based SoC Clock Updates for v3.17

* Fix device node reference leakage in shmobile_init_delay
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTp4DrAAoJENfPZGlqN0++5KwP/ibYOH+d82FglR5Qa5Fv/OiB
 nlRsyDqoIagi2t5/Kt66JQEUxQJtYxjM4GjiVEIoFjvaIHzTovjh/ZggjuVFfSOO
 TnupqdUd4nkhsOXBdKk4/6ZhCQTX1aP6961ekBHdCYoeaw4p4UyGDB1StNfGOz7f
 8+egjbB44dJb1QfZeQBb/Vn3UbOcZVT16oT1DczA+N4dE823330Y7H99wp7fwKGd
 6r+5EeOtzZRfQ6YOTh9TYtPkyTffpQ8UfM3lkFQ6IlYsbwe8w2+Q+wotTe8u5Ksm
 +2K7v/QMzWLl3Zx7Ne9iIzEGq9gVLmrl1AG6Bxjl6SKiqXxxu2FEpTICXl0wCEpE
 d/u7ko8O1btqLLIBlH3d+8oKx8zEMJgMGzJv3Ib8DE7iBW2vDjoXDZSO3cL1Ok27
 9uliufo08dgmudajbgPeRJjREso/kUcT8ykSun4jPfKJtvbHl0Gh63svO4oW498E
 zxxHs5Ip9RzpgGAPr7+5/PHE0NN9fhPVbXASWJsLvP61L1uJtIQC/89SyUvvobp2
 TrA4qFLbX8ov8mNsXe8vERZNJUlERMQDD6eGz6I9C76J4aGbrC84bC/9tOmx3S6K
 SEXDGPak4lIQs51S/rVDPqH9ClcafoCdT4YIooKh/+ltWgcws+To60yfSRkkqu7i
 tH3YM+RPpNgyAvt+Xsa4
 =iPgO
 -----END PGP SIGNATURE-----

Merge tag 'renesas-clock-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc

Merge "Renesas ARM Based SoC Clock Updates for v3.17" from Simon Horman:

- Fix device node reference leakage in shmobile_init_delay

* tag 'renesas-clock-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: Fix device node reference leakage in shmobile_init_delay

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2014-07-06 17:05:25 -07:00
commit 9e205f02c2

View file

@ -59,29 +59,37 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
void __init shmobile_init_delay(void)
{
struct device_node *np, *parent;
u32 max_freq, freq;
struct device_node *np, *cpus;
bool is_a8_a9 = false;
bool is_a15 = false;
u32 max_freq = 0;
max_freq = 0;
cpus = of_find_node_by_path("/cpus");
if (!cpus)
return;
parent = of_find_node_by_path("/cpus");
if (parent) {
for_each_child_of_node(parent, np) {
if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq);
}
of_node_put(parent);
for_each_child_of_node(cpus, np) {
u32 freq;
if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq);
if (of_device_is_compatible(np, "arm,cortex-a8") ||
of_device_is_compatible(np, "arm,cortex-a9"))
is_a8_a9 = true;
else if (of_device_is_compatible(np, "arm,cortex-a15"))
is_a15 = true;
}
if (max_freq) {
if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8"))
shmobile_setup_delay_hz(max_freq, 1, 3);
else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
shmobile_setup_delay_hz(max_freq, 1, 3);
else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15"))
if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
shmobile_setup_delay_hz(max_freq, 2, 4);
}
of_node_put(cpus);
if (!max_freq)
return;
if (is_a8_a9)
shmobile_setup_delay_hz(max_freq, 1, 3);
else if (is_a15 && !IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
shmobile_setup_delay_hz(max_freq, 2, 4);
}
static void __init shmobile_late_time_init(void)