Skip to content

Commit

Permalink
staging: nvec: implement unregistering of notifiers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Dietrich authored and Greg Kroah-Hartman committed May 14, 2013
1 parent 99758de commit 111c158
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,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
*
Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/nvec/nvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 111c158

Please sign in to comment.