21 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/device.h>
52 spin_lock_irq(&pps_kc_hardpps_lock);
54 if (bind_args->
edge == 0)
55 if (pps_kc_hardpps_dev == pps) {
57 pps_kc_hardpps_dev =
NULL;
58 spin_unlock_irq(&pps_kc_hardpps_lock);
62 spin_unlock_irq(&pps_kc_hardpps_lock);
68 if (pps_kc_hardpps_dev ==
NULL ||
69 pps_kc_hardpps_dev == pps) {
71 pps_kc_hardpps_dev = pps;
72 spin_unlock_irq(&pps_kc_hardpps_lock);
74 "edge=0x%x\n", bind_args->
edge);
76 spin_unlock_irq(&pps_kc_hardpps_lock);
78 " is already bound\n");
94 spin_lock_irq(&pps_kc_hardpps_lock);
95 if (pps == pps_kc_hardpps_dev) {
97 pps_kc_hardpps_dev =
NULL;
98 spin_unlock_irq(&pps_kc_hardpps_lock);
100 " on device removal\n");
102 spin_unlock_irq(&pps_kc_hardpps_lock);
121 spin_unlock_irqrestore(&pps_kc_hardpps_lock, flags);