ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable
ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable

Previously the code only acquired spinlock after increasing / decreasing
the usecount value, which is wrong. This leaves a small window where
a task switch may occur between the check of the usecount and the actual
wakeup / sleep of the domain. Fixed by moving the spinlock locking before
the usecount access. Left the usecount as atomic_t if someone wants an
easy access to the parameter through atomic_read.

Signed-off-by: Tero Kristo <060a12f1fbc7e2e5d830b72f402ff04fdae8d312@ti.com>
Acked-by: Paul Walmsley <a027184a55211cd23e3f3094f1fdc728df5e0500@pwsan.com>
Signed-off-by: Tony Lindgren <1001e8702733cced254345e193c88aaa47a4f5de@atomide.com>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs