diff options
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r-- | drivers/sbus/char/bpp.c | 3 | ||||
-rw-r--r-- | drivers/sbus/char/cpwatchdog.c | 4 | ||||
-rw-r--r-- | drivers/sbus/char/display7seg.c | 1 | ||||
-rw-r--r-- | drivers/sbus/char/envctrl.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/flash.c | 6 | ||||
-rw-r--r-- | drivers/sbus/char/jsflash.c | 13 | ||||
-rw-r--r-- | drivers/sbus/char/openprom.c | 3 | ||||
-rw-r--r-- | drivers/sbus/char/riowatchdog.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/rtc.c | 3 | ||||
-rw-r--r-- | drivers/sbus/char/uctrl.c | 19 | ||||
-rw-r--r-- | drivers/sbus/char/vfc.h | 4 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 44 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_i2c.c | 12 |
13 files changed, 73 insertions, 43 deletions
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c index 03c966059471..bba21e053a1b 100644 --- a/drivers/sbus/char/bpp.c +++ b/drivers/sbus/char/bpp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/timer.h> | 19 | #include <linux/timer.h> |
20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
21 | #include <linux/major.h> | 21 | #include <linux/major.h> |
22 | #include <linux/smp_lock.h> | ||
22 | 23 | ||
23 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
@@ -429,6 +430,7 @@ static int bpp_open(struct inode *inode, struct file *f) | |||
429 | unsigned minor = iminor(inode); | 430 | unsigned minor = iminor(inode); |
430 | int ret; | 431 | int ret; |
431 | 432 | ||
433 | lock_kernel(); | ||
432 | spin_lock(&bpp_open_lock); | 434 | spin_lock(&bpp_open_lock); |
433 | ret = 0; | 435 | ret = 0; |
434 | if (minor >= BPP_NO) { | 436 | if (minor >= BPP_NO) { |
@@ -444,6 +446,7 @@ static int bpp_open(struct inode *inode, struct file *f) | |||
444 | } | 446 | } |
445 | } | 447 | } |
446 | spin_unlock(&bpp_open_lock); | 448 | spin_unlock(&bpp_open_lock); |
449 | unlock_kernel(); | ||
447 | 450 | ||
448 | return ret; | 451 | return ret; |
449 | } | 452 | } |
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c index 235703414370..23abfdfb44f1 100644 --- a/drivers/sbus/char/cpwatchdog.c +++ b/drivers/sbus/char/cpwatchdog.c | |||
@@ -279,6 +279,7 @@ static inline int wd_opt_timeout(void) | |||
279 | 279 | ||
280 | static int wd_open(struct inode *inode, struct file *f) | 280 | static int wd_open(struct inode *inode, struct file *f) |
281 | { | 281 | { |
282 | lock_kernel(); | ||
282 | switch(iminor(inode)) | 283 | switch(iminor(inode)) |
283 | { | 284 | { |
284 | case WD0_MINOR: | 285 | case WD0_MINOR: |
@@ -291,6 +292,7 @@ static int wd_open(struct inode *inode, struct file *f) | |||
291 | f->private_data = &wd_dev.watchdog[WD2_ID]; | 292 | f->private_data = &wd_dev.watchdog[WD2_ID]; |
292 | break; | 293 | break; |
293 | default: | 294 | default: |
295 | unlock_kernel(); | ||
294 | return(-ENODEV); | 296 | return(-ENODEV); |
295 | } | 297 | } |
296 | 298 | ||
@@ -304,11 +306,13 @@ static int wd_open(struct inode *inode, struct file *f) | |||
304 | (void *)wd_dev.regs)) { | 306 | (void *)wd_dev.regs)) { |
305 | printk("%s: Cannot register IRQ %d\n", | 307 | printk("%s: Cannot register IRQ %d\n", |
306 | WD_OBPNAME, wd_dev.irq); | 308 | WD_OBPNAME, wd_dev.irq); |
309 | unlock_kernel(); | ||
307 | return(-EBUSY); | 310 | return(-EBUSY); |
308 | } | 311 | } |
309 | wd_dev.initialized = 1; | 312 | wd_dev.initialized = 1; |
310 | } | 313 | } |
311 | 314 | ||
315 | unlock_kernel(); | ||
312 | return(nonseekable_open(inode, f)); | 316 | return(nonseekable_open(inode, f)); |
313 | } | 317 | } |
314 | 318 | ||
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index 3279a1b6501d..d8f5c0ca236d 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c | |||
@@ -94,6 +94,7 @@ static int d7s_open(struct inode *inode, struct file *f) | |||
94 | { | 94 | { |
95 | if (D7S_MINOR != iminor(inode)) | 95 | if (D7S_MINOR != iminor(inode)) |
96 | return -ENODEV; | 96 | return -ENODEV; |
97 | cycle_kernel_lock(); | ||
97 | atomic_inc(&d7s_users); | 98 | atomic_inc(&d7s_users); |
98 | return 0; | 99 | return 0; |
99 | } | 100 | } |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index dadabef116b6..a408402426f8 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/miscdevice.h> | 27 | #include <linux/miscdevice.h> |
28 | #include <linux/kmod.h> | 28 | #include <linux/kmod.h> |
29 | #include <linux/reboot.h> | 29 | #include <linux/reboot.h> |
30 | #include <linux/smp_lock.h> | ||
30 | 31 | ||
31 | #include <asm/ebus.h> | 32 | #include <asm/ebus.h> |
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
@@ -694,6 +695,7 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
694 | static int | 695 | static int |
695 | envctrl_open(struct inode *inode, struct file *file) | 696 | envctrl_open(struct inode *inode, struct file *file) |
696 | { | 697 | { |
698 | cycle_kernel_lock(); | ||
697 | file->private_data = NULL; | 699 | file->private_data = NULL; |
698 | return 0; | 700 | return 0; |
699 | } | 701 | } |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 44e039865aa9..7d95e151513a 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -127,9 +127,13 @@ flash_read(struct file * file, char __user * buf, | |||
127 | static int | 127 | static int |
128 | flash_open(struct inode *inode, struct file *file) | 128 | flash_open(struct inode *inode, struct file *file) |
129 | { | 129 | { |
130 | if (test_and_set_bit(0, (void *)&flash.busy) != 0) | 130 | lock_kernel(); |
131 | if (test_and_set_bit(0, (void *)&flash.busy) != 0) { | ||
132 | unlock_kernel(); | ||
131 | return -EBUSY; | 133 | return -EBUSY; |
134 | } | ||
132 | 135 | ||
136 | unlock_kernel(); | ||
133 | return 0; | 137 | return 0; |
134 | } | 138 | } |
135 | 139 | ||
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 4b7079fdc10c..2bec9ccc0293 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/smp_lock.h> | ||
30 | #include <linux/types.h> | 31 | #include <linux/types.h> |
31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
32 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
@@ -417,11 +418,17 @@ static int jsf_mmap(struct file * file, struct vm_area_struct * vma) | |||
417 | 418 | ||
418 | static int jsf_open(struct inode * inode, struct file * filp) | 419 | static int jsf_open(struct inode * inode, struct file * filp) |
419 | { | 420 | { |
420 | 421 | lock_kernel(); | |
421 | if (jsf0.base == 0) return -ENXIO; | 422 | if (jsf0.base == 0) { |
422 | if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) | 423 | unlock_kernel(); |
424 | return -ENXIO; | ||
425 | } | ||
426 | if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) { | ||
427 | unlock_kernel(); | ||
423 | return -EBUSY; | 428 | return -EBUSY; |
429 | } | ||
424 | 430 | ||
431 | unlock_kernel(); | ||
425 | return 0; /* XXX What security? */ | 432 | return 0; /* XXX What security? */ |
426 | } | 433 | } |
427 | 434 | ||
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index fbfeb89a6f32..29dc735e1a20 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <linux/smp_lock.h> | ||
36 | #include <linux/string.h> | 37 | #include <linux/string.h> |
37 | #include <linux/miscdevice.h> | 38 | #include <linux/miscdevice.h> |
38 | #include <linux/init.h> | 39 | #include <linux/init.h> |
@@ -689,9 +690,11 @@ static int openprom_open(struct inode * inode, struct file * file) | |||
689 | if (!data) | 690 | if (!data) |
690 | return -ENOMEM; | 691 | return -ENOMEM; |
691 | 692 | ||
693 | lock_kernel(); | ||
692 | data->current_node = of_find_node_by_path("/"); | 694 | data->current_node = of_find_node_by_path("/"); |
693 | data->lastnode = data->current_node; | 695 | data->lastnode = data->current_node; |
694 | file->private_data = (void *) data; | 696 | file->private_data = (void *) data; |
697 | unlock_kernel(); | ||
695 | 698 | ||
696 | return 0; | 699 | return 0; |
697 | } | 700 | } |
diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c index a2fc6b8c1334..88c0fc6395e1 100644 --- a/drivers/sbus/char/riowatchdog.c +++ b/drivers/sbus/char/riowatchdog.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
14 | #include <linux/smp_lock.h> | ||
14 | 15 | ||
15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
16 | #include <asm/ebus.h> | 17 | #include <asm/ebus.h> |
@@ -116,6 +117,7 @@ static void riowd_starttimer(void) | |||
116 | 117 | ||
117 | static int riowd_open(struct inode *inode, struct file *filp) | 118 | static int riowd_open(struct inode *inode, struct file *filp) |
118 | { | 119 | { |
120 | cycle_kernel_lock(); | ||
119 | nonseekable_open(inode, filp); | 121 | nonseekable_open(inode, filp); |
120 | return 0; | 122 | return 0; |
121 | } | 123 | } |
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 18d18f1a114e..b0429917154d 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/smp_lock.h> | ||
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
17 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
@@ -213,6 +214,7 @@ static int rtc_open(struct inode *inode, struct file *file) | |||
213 | { | 214 | { |
214 | int ret; | 215 | int ret; |
215 | 216 | ||
217 | lock_kernel(); | ||
216 | spin_lock_irq(&mostek_lock); | 218 | spin_lock_irq(&mostek_lock); |
217 | if (rtc_busy) { | 219 | if (rtc_busy) { |
218 | ret = -EBUSY; | 220 | ret = -EBUSY; |
@@ -221,6 +223,7 @@ static int rtc_open(struct inode *inode, struct file *file) | |||
221 | ret = 0; | 223 | ret = 0; |
222 | } | 224 | } |
223 | spin_unlock_irq(&mostek_lock); | 225 | spin_unlock_irq(&mostek_lock); |
226 | unlock_kernel(); | ||
224 | 227 | ||
225 | return ret; | 228 | return ret; |
226 | } | 229 | } |
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 383f32c1d347..777637594acd 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/smp_lock.h> | ||
12 | #include <linux/ioport.h> | 13 | #include <linux/ioport.h> |
13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
14 | #include <linux/miscdevice.h> | 15 | #include <linux/miscdevice.h> |
@@ -194,8 +195,8 @@ struct uctrl_driver { | |||
194 | 195 | ||
195 | static struct uctrl_driver drv; | 196 | static struct uctrl_driver drv; |
196 | 197 | ||
197 | void uctrl_get_event_status(void); | 198 | static void uctrl_get_event_status(void); |
198 | void uctrl_get_external_status(void); | 199 | static void uctrl_get_external_status(void); |
199 | 200 | ||
200 | static int | 201 | static int |
201 | uctrl_ioctl(struct inode *inode, struct file *file, | 202 | uctrl_ioctl(struct inode *inode, struct file *file, |
@@ -211,8 +212,10 @@ uctrl_ioctl(struct inode *inode, struct file *file, | |||
211 | static int | 212 | static int |
212 | uctrl_open(struct inode *inode, struct file *file) | 213 | uctrl_open(struct inode *inode, struct file *file) |
213 | { | 214 | { |
215 | lock_kernel(); | ||
214 | uctrl_get_event_status(); | 216 | uctrl_get_event_status(); |
215 | uctrl_get_external_status(); | 217 | uctrl_get_external_status(); |
218 | unlock_kernel(); | ||
216 | return 0; | 219 | return 0; |
217 | } | 220 | } |
218 | 221 | ||
@@ -263,12 +266,6 @@ static struct miscdevice uctrl_dev = { | |||
263 | driver->regs->uctrl_stat = UCTRL_STAT_RXNE_STA; \ | 266 | driver->regs->uctrl_stat = UCTRL_STAT_RXNE_STA; \ |
264 | } | 267 | } |
265 | 268 | ||
266 | void uctrl_set_video(int status) | ||
267 | { | ||
268 | struct uctrl_driver *driver = &drv; | ||
269 | |||
270 | } | ||
271 | |||
272 | static void uctrl_do_txn(struct uctrl_txn *txn) | 269 | static void uctrl_do_txn(struct uctrl_txn *txn) |
273 | { | 270 | { |
274 | struct uctrl_driver *driver = &drv; | 271 | struct uctrl_driver *driver = &drv; |
@@ -308,7 +305,7 @@ static void uctrl_do_txn(struct uctrl_txn *txn) | |||
308 | } | 305 | } |
309 | } | 306 | } |
310 | 307 | ||
311 | void uctrl_get_event_status(void) | 308 | static void uctrl_get_event_status(void) |
312 | { | 309 | { |
313 | struct uctrl_driver *driver = &drv; | 310 | struct uctrl_driver *driver = &drv; |
314 | struct uctrl_txn txn; | 311 | struct uctrl_txn txn; |
@@ -328,7 +325,7 @@ void uctrl_get_event_status(void) | |||
328 | dprintk(("ev is %x\n", driver->status.event_status)); | 325 | dprintk(("ev is %x\n", driver->status.event_status)); |
329 | } | 326 | } |
330 | 327 | ||
331 | void uctrl_get_external_status(void) | 328 | static void uctrl_get_external_status(void) |
332 | { | 329 | { |
333 | struct uctrl_driver *driver = &drv; | 330 | struct uctrl_driver *driver = &drv; |
334 | struct uctrl_txn txn; | 331 | struct uctrl_txn txn; |
@@ -360,7 +357,7 @@ void uctrl_get_external_status(void) | |||
360 | static int __init ts102_uctrl_init(void) | 357 | static int __init ts102_uctrl_init(void) |
361 | { | 358 | { |
362 | struct uctrl_driver *driver = &drv; | 359 | struct uctrl_driver *driver = &drv; |
363 | int len, i; | 360 | int len; |
364 | struct linux_prom_irqs tmp_irq[2]; | 361 | struct linux_prom_irqs tmp_irq[2]; |
365 | unsigned int vaddr[2] = { 0, 0 }; | 362 | unsigned int vaddr[2] = { 0, 0 }; |
366 | int tmpnode, uctrlnode = prom_getchild(prom_root_node); | 363 | int tmpnode, uctrlnode = prom_getchild(prom_root_node); |
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h index f1aa1389ea4a..a5240c52aa0b 100644 --- a/drivers/sbus/char/vfc.h +++ b/drivers/sbus/char/vfc.h | |||
@@ -133,8 +133,6 @@ struct vfc_dev { | |||
133 | unsigned char saa9051_state_array[VFC_SAA9051_NR]; | 133 | unsigned char saa9051_state_array[VFC_SAA9051_NR]; |
134 | }; | 134 | }; |
135 | 135 | ||
136 | extern struct vfc_dev **vfc_dev_lst; | ||
137 | |||
138 | void captstat_reset(struct vfc_dev *); | 136 | void captstat_reset(struct vfc_dev *); |
139 | void memptr_reset(struct vfc_dev *); | 137 | void memptr_reset(struct vfc_dev *); |
140 | 138 | ||
@@ -145,8 +143,6 @@ int vfc_i2c_sendbuf(struct vfc_dev *, unsigned char, char *, int) ; | |||
145 | int vfc_i2c_recvbuf(struct vfc_dev *, unsigned char, char *, int) ; | 143 | int vfc_i2c_recvbuf(struct vfc_dev *, unsigned char, char *, int) ; |
146 | int vfc_i2c_reset_bus(struct vfc_dev *); | 144 | int vfc_i2c_reset_bus(struct vfc_dev *); |
147 | int vfc_init_i2c_bus(struct vfc_dev *); | 145 | int vfc_init_i2c_bus(struct vfc_dev *); |
148 | void vfc_lock_device(struct vfc_dev *); | ||
149 | void vfc_unlock_device(struct vfc_dev *); | ||
150 | 146 | ||
151 | #define VFC_CONTROL_DIAGMODE 0x10000000 | 147 | #define VFC_CONTROL_DIAGMODE 0x10000000 |
152 | #define VFC_CONTROL_MEMPTR 0x20000000 | 148 | #define VFC_CONTROL_MEMPTR 0x20000000 |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index d4f8fcded51d..25181bb7d627 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
26 | #include <linux/mm.h> | 26 | #include <linux/mm.h> |
27 | #include <linux/smp_lock.h> | ||
27 | 28 | ||
28 | #include <asm/openprom.h> | 29 | #include <asm/openprom.h> |
29 | #include <asm/oplib.h> | 30 | #include <asm/oplib.h> |
@@ -44,7 +45,7 @@ | |||
44 | #include <asm/vfc_ioctls.h> | 45 | #include <asm/vfc_ioctls.h> |
45 | 46 | ||
46 | static const struct file_operations vfc_fops; | 47 | static const struct file_operations vfc_fops; |
47 | struct vfc_dev **vfc_dev_lst; | 48 | static struct vfc_dev **vfc_dev_lst; |
48 | static char vfcstr[]="vfc"; | 49 | static char vfcstr[]="vfc"; |
49 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | 50 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { |
50 | 0x00, 0x64, 0x72, 0x52, | 51 | 0x00, 0x64, 0x72, 0x52, |
@@ -53,18 +54,18 @@ static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | |||
53 | 0x3e | 54 | 0x3e |
54 | }; | 55 | }; |
55 | 56 | ||
56 | void vfc_lock_device(struct vfc_dev *dev) | 57 | static void vfc_lock_device(struct vfc_dev *dev) |
57 | { | 58 | { |
58 | mutex_lock(&dev->device_lock_mtx); | 59 | mutex_lock(&dev->device_lock_mtx); |
59 | } | 60 | } |
60 | 61 | ||
61 | void vfc_unlock_device(struct vfc_dev *dev) | 62 | static void vfc_unlock_device(struct vfc_dev *dev) |
62 | { | 63 | { |
63 | mutex_unlock(&dev->device_lock_mtx); | 64 | mutex_unlock(&dev->device_lock_mtx); |
64 | } | 65 | } |
65 | 66 | ||
66 | 67 | ||
67 | void vfc_captstat_reset(struct vfc_dev *dev) | 68 | static void vfc_captstat_reset(struct vfc_dev *dev) |
68 | { | 69 | { |
69 | dev->control_reg |= VFC_CONTROL_CAPTRESET; | 70 | dev->control_reg |= VFC_CONTROL_CAPTRESET; |
70 | sbus_writel(dev->control_reg, &dev->regs->control); | 71 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -74,7 +75,7 @@ void vfc_captstat_reset(struct vfc_dev *dev) | |||
74 | sbus_writel(dev->control_reg, &dev->regs->control); | 75 | sbus_writel(dev->control_reg, &dev->regs->control); |
75 | } | 76 | } |
76 | 77 | ||
77 | void vfc_memptr_reset(struct vfc_dev *dev) | 78 | static void vfc_memptr_reset(struct vfc_dev *dev) |
78 | { | 79 | { |
79 | dev->control_reg |= VFC_CONTROL_MEMPTR; | 80 | dev->control_reg |= VFC_CONTROL_MEMPTR; |
80 | sbus_writel(dev->control_reg, &dev->regs->control); | 81 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -84,7 +85,7 @@ void vfc_memptr_reset(struct vfc_dev *dev) | |||
84 | sbus_writel(dev->control_reg, &dev->regs->control); | 85 | sbus_writel(dev->control_reg, &dev->regs->control); |
85 | } | 86 | } |
86 | 87 | ||
87 | int vfc_csr_init(struct vfc_dev *dev) | 88 | static int vfc_csr_init(struct vfc_dev *dev) |
88 | { | 89 | { |
89 | dev->control_reg = 0x80000000; | 90 | dev->control_reg = 0x80000000; |
90 | sbus_writel(dev->control_reg, &dev->regs->control); | 91 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -106,7 +107,7 @@ int vfc_csr_init(struct vfc_dev *dev) | |||
106 | return 0; | 107 | return 0; |
107 | } | 108 | } |
108 | 109 | ||
109 | int vfc_saa9051_init(struct vfc_dev *dev) | 110 | static int vfc_saa9051_init(struct vfc_dev *dev) |
110 | { | 111 | { |
111 | int i; | 112 | int i; |
112 | 113 | ||
@@ -118,7 +119,7 @@ int vfc_saa9051_init(struct vfc_dev *dev) | |||
118 | return 0; | 119 | return 0; |
119 | } | 120 | } |
120 | 121 | ||
121 | int init_vfc_hw(struct vfc_dev *dev) | 122 | static int init_vfc_hw(struct vfc_dev *dev) |
122 | { | 123 | { |
123 | vfc_lock_device(dev); | 124 | vfc_lock_device(dev); |
124 | vfc_csr_init(dev); | 125 | vfc_csr_init(dev); |
@@ -131,7 +132,7 @@ int init_vfc_hw(struct vfc_dev *dev) | |||
131 | return 0; | 132 | return 0; |
132 | } | 133 | } |
133 | 134 | ||
134 | int init_vfc_devstruct(struct vfc_dev *dev, int instance) | 135 | static int init_vfc_devstruct(struct vfc_dev *dev, int instance) |
135 | { | 136 | { |
136 | dev->instance=instance; | 137 | dev->instance=instance; |
137 | mutex_init(&dev->device_lock_mtx); | 138 | mutex_init(&dev->device_lock_mtx); |
@@ -140,7 +141,8 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) | |||
140 | return 0; | 141 | return 0; |
141 | } | 142 | } |
142 | 143 | ||
143 | int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) | 144 | static int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, |
145 | int instance) | ||
144 | { | 146 | { |
145 | if(dev == NULL) { | 147 | if(dev == NULL) { |
146 | printk(KERN_ERR "VFC: Bogus pointer passed\n"); | 148 | printk(KERN_ERR "VFC: Bogus pointer passed\n"); |
@@ -167,7 +169,7 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) | |||
167 | } | 169 | } |
168 | 170 | ||
169 | 171 | ||
170 | struct vfc_dev *vfc_get_dev_ptr(int instance) | 172 | static struct vfc_dev *vfc_get_dev_ptr(int instance) |
171 | { | 173 | { |
172 | return vfc_dev_lst[instance]; | 174 | return vfc_dev_lst[instance]; |
173 | } | 175 | } |
@@ -178,14 +180,17 @@ static int vfc_open(struct inode *inode, struct file *file) | |||
178 | { | 180 | { |
179 | struct vfc_dev *dev; | 181 | struct vfc_dev *dev; |
180 | 182 | ||
183 | lock_kernel(); | ||
181 | spin_lock(&vfc_dev_lock); | 184 | spin_lock(&vfc_dev_lock); |
182 | dev = vfc_get_dev_ptr(iminor(inode)); | 185 | dev = vfc_get_dev_ptr(iminor(inode)); |
183 | if (dev == NULL) { | 186 | if (dev == NULL) { |
184 | spin_unlock(&vfc_dev_lock); | 187 | spin_unlock(&vfc_dev_lock); |
188 | unlock_kernel(); | ||
185 | return -ENODEV; | 189 | return -ENODEV; |
186 | } | 190 | } |
187 | if (dev->busy) { | 191 | if (dev->busy) { |
188 | spin_unlock(&vfc_dev_lock); | 192 | spin_unlock(&vfc_dev_lock); |
193 | unlock_kernel(); | ||
189 | return -EBUSY; | 194 | return -EBUSY; |
190 | } | 195 | } |
191 | 196 | ||
@@ -202,6 +207,7 @@ static int vfc_open(struct inode *inode, struct file *file) | |||
202 | vfc_captstat_reset(dev); | 207 | vfc_captstat_reset(dev); |
203 | 208 | ||
204 | vfc_unlock_device(dev); | 209 | vfc_unlock_device(dev); |
210 | unlock_kernel(); | ||
205 | return 0; | 211 | return 0; |
206 | } | 212 | } |
207 | 213 | ||
@@ -287,7 +293,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) | |||
287 | return 0; | 293 | return 0; |
288 | } | 294 | } |
289 | 295 | ||
290 | int vfc_capture_start(struct vfc_dev *dev) | 296 | static int vfc_capture_start(struct vfc_dev *dev) |
291 | { | 297 | { |
292 | vfc_captstat_reset(dev); | 298 | vfc_captstat_reset(dev); |
293 | dev->control_reg = sbus_readl(&dev->regs->control); | 299 | dev->control_reg = sbus_readl(&dev->regs->control); |
@@ -309,7 +315,7 @@ int vfc_capture_start(struct vfc_dev *dev) | |||
309 | return 0; | 315 | return 0; |
310 | } | 316 | } |
311 | 317 | ||
312 | int vfc_capture_poll(struct vfc_dev *dev) | 318 | static int vfc_capture_poll(struct vfc_dev *dev) |
313 | { | 319 | { |
314 | int timeout = 1000; | 320 | int timeout = 1000; |
315 | 321 | ||
@@ -385,8 +391,8 @@ static int vfc_set_control_ioctl(struct inode *inode, struct file *file, | |||
385 | } | 391 | } |
386 | 392 | ||
387 | 393 | ||
388 | int vfc_port_change_ioctl(struct inode *inode, struct file *file, | 394 | static int vfc_port_change_ioctl(struct inode *inode, struct file *file, |
389 | struct vfc_dev *dev, unsigned long arg) | 395 | struct vfc_dev *dev, unsigned long arg) |
390 | { | 396 | { |
391 | int ret = 0; | 397 | int ret = 0; |
392 | int cmd; | 398 | int cmd; |
@@ -455,8 +461,8 @@ int vfc_port_change_ioctl(struct inode *inode, struct file *file, | |||
455 | return ret; | 461 | return ret; |
456 | } | 462 | } |
457 | 463 | ||
458 | int vfc_set_video_ioctl(struct inode *inode, struct file *file, | 464 | static int vfc_set_video_ioctl(struct inode *inode, struct file *file, |
459 | struct vfc_dev *dev, unsigned long arg) | 465 | struct vfc_dev *dev, unsigned long arg) |
460 | { | 466 | { |
461 | int ret = 0; | 467 | int ret = 0; |
462 | int cmd; | 468 | int cmd; |
@@ -506,8 +512,8 @@ int vfc_set_video_ioctl(struct inode *inode, struct file *file, | |||
506 | return ret; | 512 | return ret; |
507 | } | 513 | } |
508 | 514 | ||
509 | int vfc_get_video_ioctl(struct inode *inode, struct file *file, | 515 | static int vfc_get_video_ioctl(struct inode *inode, struct file *file, |
510 | struct vfc_dev *dev, unsigned long arg) | 516 | struct vfc_dev *dev, unsigned long arg) |
511 | { | 517 | { |
512 | int ret = 0; | 518 | int ret = 0; |
513 | unsigned int status = NO_LOCK; | 519 | unsigned int status = NO_LOCK; |
diff --git a/drivers/sbus/char/vfc_i2c.c b/drivers/sbus/char/vfc_i2c.c index 9efed771f6c0..32b986e0ed78 100644 --- a/drivers/sbus/char/vfc_i2c.c +++ b/drivers/sbus/char/vfc_i2c.c | |||
@@ -114,7 +114,7 @@ int vfc_i2c_reset_bus(struct vfc_dev *dev) | |||
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | int vfc_i2c_wait_for_bus(struct vfc_dev *dev) | 117 | static int vfc_i2c_wait_for_bus(struct vfc_dev *dev) |
118 | { | 118 | { |
119 | int timeout = 1000; | 119 | int timeout = 1000; |
120 | 120 | ||
@@ -126,7 +126,7 @@ int vfc_i2c_wait_for_bus(struct vfc_dev *dev) | |||
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | int vfc_i2c_wait_for_pin(struct vfc_dev *dev, int ack) | 129 | static int vfc_i2c_wait_for_pin(struct vfc_dev *dev, int ack) |
130 | { | 130 | { |
131 | int timeout = 1000; | 131 | int timeout = 1000; |
132 | int s1; | 132 | int s1; |
@@ -144,7 +144,8 @@ int vfc_i2c_wait_for_pin(struct vfc_dev *dev, int ack) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | #define SHIFT(a) ((a) << 24) | 146 | #define SHIFT(a) ((a) << 24) |
147 | int vfc_i2c_xmit_addr(struct vfc_dev *dev, unsigned char addr, char mode) | 147 | static int vfc_i2c_xmit_addr(struct vfc_dev *dev, unsigned char addr, |
148 | char mode) | ||
148 | { | 149 | { |
149 | int ret, raddr; | 150 | int ret, raddr; |
150 | #if 1 | 151 | #if 1 |
@@ -195,7 +196,7 @@ int vfc_i2c_xmit_addr(struct vfc_dev *dev, unsigned char addr, char mode) | |||
195 | return 0; | 196 | return 0; |
196 | } | 197 | } |
197 | 198 | ||
198 | int vfc_i2c_xmit_byte(struct vfc_dev *dev,unsigned char *byte) | 199 | static int vfc_i2c_xmit_byte(struct vfc_dev *dev,unsigned char *byte) |
199 | { | 200 | { |
200 | int ret; | 201 | int ret; |
201 | u32 val = SHIFT((unsigned int)*byte); | 202 | u32 val = SHIFT((unsigned int)*byte); |
@@ -218,7 +219,8 @@ int vfc_i2c_xmit_byte(struct vfc_dev *dev,unsigned char *byte) | |||
218 | return ret; | 219 | return ret; |
219 | } | 220 | } |
220 | 221 | ||
221 | int vfc_i2c_recv_byte(struct vfc_dev *dev, unsigned char *byte, int last) | 222 | static int vfc_i2c_recv_byte(struct vfc_dev *dev, unsigned char *byte, |
223 | int last) | ||
222 | { | 224 | { |
223 | int ret; | 225 | int ret; |
224 | 226 | ||