net: ipa: use refcount_t for IPA clock reference count
authorAlex Elder <elder@linaro.org>
Thu, 17 Sep 2020 17:39:20 +0000 (12:39 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Sep 2020 00:47:07 +0000 (17:47 -0700)
commit0305b709906e755d7fbdeccd9c2539442ebd1ead
treed53482ce68587e3f06120e41e75e583cfc35c7fe
parentba4ee3c053659119472135231dbef8f6880ce1fb
net: ipa: use refcount_t for IPA clock reference count

Take advantage of the checking provided by refcount_t, rather than
using a plain atomic to represent the IPA clock reference count.

Note that we need to *set* the value to 1 in ipa_clock_get() rather
than incrementing it from 0 (because doing that is considered an
error for a refcount_t).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_clock.c