aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2008-09-22 22:18:15 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-22 22:18:15 -0400
commitce425a9f2c0182e9a9e49c7dc18699f2db4c3f48 (patch)
tree599dd45e4c784cff830888b31c55737b7e250033 /drivers/isdn/mISDN
parent1532dcb75c238d79c54a037da87c3f495cbf605b (diff)
mISDN: misc timerdev fixes
- Remove noop VFS stubs. The VFS does that on a NULL pointer anyways. - Fix timer handler prototype to be correct - Comment ugly SMP race I didn't fix. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r--drivers/isdn/mISDN/timerdev.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index b5fabc7019d8..e7462924b505 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -124,18 +124,6 @@ mISDN_read(struct file *filep, char *buf, size_t count, loff_t *off)
124 return ret; 124 return ret;
125} 125}
126 126
127static loff_t
128mISDN_llseek(struct file *filep, loff_t offset, int orig)
129{
130 return -ESPIPE;
131}
132
133static ssize_t
134mISDN_write(struct file *filep, const char *buf, size_t count, loff_t *off)
135{
136 return -EOPNOTSUPP;
137}
138
139static unsigned int 127static unsigned int
140mISDN_poll(struct file *filep, poll_table *wait) 128mISDN_poll(struct file *filep, poll_table *wait)
141{ 129{
@@ -157,8 +145,9 @@ mISDN_poll(struct file *filep, poll_table *wait)
157} 145}
158 146
159static void 147static void
160dev_expire_timer(struct mISDNtimer *timer) 148dev_expire_timer(unsigned long data)
161{ 149{
150 struct mISDNtimer *timer = (void *)data;
162 u_long flags; 151 u_long flags;
163 152
164 spin_lock_irqsave(&timer->dev->lock, flags); 153 spin_lock_irqsave(&timer->dev->lock, flags);
@@ -191,7 +180,7 @@ misdn_add_timer(struct mISDNtimerdev *dev, int timeout)
191 spin_unlock_irqrestore(&dev->lock, flags); 180 spin_unlock_irqrestore(&dev->lock, flags);
192 timer->dev = dev; 181 timer->dev = dev;
193 timer->tl.data = (long)timer; 182 timer->tl.data = (long)timer;
194 timer->tl.function = (void *) dev_expire_timer; 183 timer->tl.function = dev_expire_timer;
195 init_timer(&timer->tl); 184 init_timer(&timer->tl);
196 timer->tl.expires = jiffies + ((HZ * (u_long)timeout) / 1000); 185 timer->tl.expires = jiffies + ((HZ * (u_long)timeout) / 1000);
197 add_timer(&timer->tl); 186 add_timer(&timer->tl);
@@ -211,6 +200,9 @@ misdn_del_timer(struct mISDNtimerdev *dev, int id)
211 list_for_each_entry(timer, &dev->pending, list) { 200 list_for_each_entry(timer, &dev->pending, list) {
212 if (timer->id == id) { 201 if (timer->id == id) {
213 list_del_init(&timer->list); 202 list_del_init(&timer->list);
203 /* RED-PEN AK: race -- timer can be still running on
204 * other CPU. Needs reference count I think
205 */
214 del_timer(&timer->tl); 206 del_timer(&timer->tl);
215 ret = timer->id; 207 ret = timer->id;
216 kfree(timer); 208 kfree(timer);
@@ -268,9 +260,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
268} 260}
269 261
270static struct file_operations mISDN_fops = { 262static struct file_operations mISDN_fops = {
271 .llseek = mISDN_llseek,
272 .read = mISDN_read, 263 .read = mISDN_read,
273 .write = mISDN_write,
274 .poll = mISDN_poll, 264 .poll = mISDN_poll,
275 .ioctl = mISDN_ioctl, 265 .ioctl = mISDN_ioctl,
276 .open = mISDN_open, 266 .open = mISDN_open,