mmc: core/card: maintain clock gating reference count integrity

Clock gating logic maintains the reference count which gets incremented
with *hold* API call and get decremented with *release* API call.
If we want to make sure that clocks are enabled during some operation,
we should call *hold* API before the operation and then call *release*
API after the operation is finished. So *hold* and *release* should be
in pair and called exactly once per operation, any violation of these
rules may put the reference count out of sync and can cause issues
(like unclocked register access). This change fixes the places where
this can go out of sync.

Change-Id: I2d784cc31027a551a466beec63ee8cd0a1f67af7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2 files changed