mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 22:51:37 +00:00
clockevents: Add module refcount
We want to be able to remove clockevent modules as well. Add a refcount so we don't remove a module with an active clock event device. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Magnus Damm <magnus.damm@gmail.com> Link: http://lkml.kernel.org/r/20130425143436.307435149@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
8c53daf63f
commit
ccf33d6880
4 changed files with 11 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
#include <linux/percpu.h>
|
||||
#include <linux/profile.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/irq_regs.h>
|
||||
|
||||
|
@ -257,6 +258,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
|
|||
goto out_bc;
|
||||
}
|
||||
|
||||
if (!try_module_get(newdev->owner))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Replace the eventually existing device by the new
|
||||
* device. If the current device is the broadcast device, do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue