Skip to content
  • Jon Hunter's avatar
    ARM: OMAP2+: Remove hard-coded test on timer ID · a7990a19
    Jon Hunter authored
    
    
    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: default avatarJon Hunter <jon-hunter@ti.com>
    Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
    a7990a19