nvmem: use kref
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 21 Sep 2018 13:40:08 +0000 (06:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:14:54 +0000 (15:14 +0200)
commitc1de7f43bd84271e438a4f2dadc4ba9a353baaea
treef08b22fddaa52f2d55f6b2cb34bacc936e8838a9
parentfa72d847d68d7833b77a4bef944cf2c5baf56f49
nvmem: use kref

Use kref for reference counting. Use an approach similar to the one
seen in the common clock subsystem: don't actually destroy the nvmem
device until the last user puts it. This way we can get rid of the
users check from nvmem_unregister().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c