]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: OMAP2+: Remove hard-coded test on timer ID
authorJon Hunter <jon-hunter@ti.com>
Tue, 12 Mar 2013 22:17:57 +0000 (17:17 -0500)
committerJon Hunter <jon-hunter@ti.com>
Mon, 1 Apr 2013 18:49:04 +0000 (13:49 -0500)
commit00389192175975adf67744cc9986b1073389bcee
treed65e84f12b0b7b7609a11e1c6ea7dc923ccd1553
parente92e4ab45dc6238fcfbb0dc919b7b08a92d770a7
ARM: OMAP2+: Remove hard-coded test on timer ID

Currently, when configuring the clock-events and clock-source timers
for OMAP2+ devices, we check whether the timer ID is 12 before
attempting to set the parent clock for the timer.

This test was added for OMAP3 general purpose devices (no security
features enabled) that a 12th timer available but unlike the other
timers only has a single functional clock source. Calling
clk_set_parent() for this 12th timer would always return an error
because there is only one choice for a parent clock. Therefore,
this hard-coded timer ID test was added.

To avoid this timer ID test, simply check to see if the timer's current
parent clock is the desired parent clock and only call clk_set_parent()
if this is not the case.

Also if clk_get() fails, then use PTR_ERR() to return the error code.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/mach-omap2/timer.c