OSDN Git Service

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)
commita7990a1952cbaea0971272692f69f62906446fdf
treed65e84f12b0b7b7609a11e1c6ea7dc923ccd1553
parente95ea43a90c32ccb47a601c70203ff60c0c1f345
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