summaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-broadcast.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-04-25 22:31:49 +0200
committerThomas Gleixner <tglx@linutronix.de>2013-05-16 11:09:17 +0200
commitccf33d6880f39a35158fff66db13000ae4943fac (patch)
treea39cb95e64c412b107c8640ae521bda78a7d1033 /kernel/time/tick-broadcast.c
parentclockevents: Move the tick_notify() switch case to clockevents_notify() (diff)
downloadlinux-ccf33d6880f39a35158fff66db13000ae4943fac.tar.xz
linux-ccf33d6880f39a35158fff66db13000ae4943fac.zip
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>
Diffstat (limited to 'kernel/time/tick-broadcast.c')
-rw-r--r--kernel/time/tick-broadcast.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 3500caaa0bfd..0e374cd2e0ef 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -19,6 +19,7 @@
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/smp.h>
+#include <linux/module.h>
#include "tick-internal.h"
@@ -73,6 +74,8 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
tick_broadcast_device.evtdev->rating >= dev->rating) ||
(dev->features & CLOCK_EVT_FEAT_C3STOP))
return;
+ if (!try_module_get(dev->owner))
+ return;
clockevents_exchange_device(tick_broadcast_device.evtdev, dev);
if (cur)