diff options
author | Marc Dietrich <marvin24@gmx.de> | 2013-04-29 23:14:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-13 17:50:06 -0400 |
commit | 218468f40d08600803ecb389c8b5139bbf736fa4 (patch) | |
tree | beee1d1bd4ba96ccf0c5b8c5b08ec2000a9f163e /drivers/staging/nvec | |
parent | 38dc92ed3019aacba7e790aa689ef65550660338 (diff) | |
download | op-kernel-dev-218468f40d08600803ecb389c8b5139bbf736fa4.zip op-kernel-dev-218468f40d08600803ecb389c8b5139bbf736fa4.tar.gz |
staging: nvec: implement unregistering of notifiers
This implements the unregistering of notifiers so kernel modules
can be unloaded.
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r-- | drivers/staging/nvec/nvec.c | 14 | ||||
-rw-r--r-- | drivers/staging/nvec/nvec.h | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index a88959f..a7800de 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -124,6 +124,20 @@ int nvec_register_notifier(struct nvec_chip *nvec, struct notifier_block *nb, EXPORT_SYMBOL_GPL(nvec_register_notifier); /** + * nvec_unregister_notifier - Unregister a notifier with nvec + * @nvec: A &struct nvec_chip + * @nb: The notifier block to unregister + * + * Unregisters a notifier with @nvec. The notifier will be removed from the + * atomic notifier chain. + */ +int nvec_unregister_notifier(struct nvec_chip *nvec, struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&nvec->notifier_list, nb); +} +EXPORT_SYMBOL_GPL(nvec_unregister_notifier); + +/** * nvec_status_notifier - The final notifier * * Prints a message about control events not handled in the notifier diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h index b7a14bc..2b1316d 100644 --- a/drivers/staging/nvec/nvec.h +++ b/drivers/staging/nvec/nvec.h @@ -197,9 +197,8 @@ extern int nvec_register_notifier(struct nvec_chip *nvec, struct notifier_block *nb, unsigned int events); -extern int nvec_unregister_notifier(struct device *dev, - struct notifier_block *nb, - unsigned int events); +extern int nvec_unregister_notifier(struct nvec_chip *dev, + struct notifier_block *nb); extern void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg); |