hwspinlock: Add devm_xxx() APIs to register/unregister one hwlock controller

This patch introduces devm_hwspin_lock_register() and devm_hwspin_lock_unregister()
interfaces to help to register or unregister one hardware spinlock controller, that
will help to simplify the cleanup code for hwspinlock drivers.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Baolin Wang 2018-06-22 16:09:00 +08:00 committed by Bjorn Andersson
parent 4f1acd758b
commit c102780acd
2 changed files with 88 additions and 0 deletions

View file

@ -71,6 +71,12 @@ int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock);
struct hwspinlock *devm_hwspin_lock_request(struct device *dev);
struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev,
unsigned int id);
int devm_hwspin_lock_unregister(struct device *dev,
struct hwspinlock_device *bank);
int devm_hwspin_lock_register(struct device *dev,
struct hwspinlock_device *bank,
const struct hwspinlock_ops *ops,
int base_id, int num_locks);
#else /* !CONFIG_HWSPINLOCK */