diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-06-05 14:44:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 00:38:17 -0400 |
commit | 960681450f8b572f230a8c3661dcc34f39fcc38e (patch) | |
tree | ba38375e57ecdfe2d97bd51b275f2fadaba51a40 | |
parent | 908f5162ca59ed46a928e8416db159777d432e77 (diff) |
drivers/sbus/: cleanups
This patch contains the following cleanups:
- make the following needlessly global code static:
- char/uctrl.c: uctrl_get_event_status()
- char/uctrl.c: uctrl_get_external_status()
- char/vfc_dev.c: struct vfc_dev_lst
- char/vfc_dev.c: vfc_lock_device()
- char/vfc_dev.c: vfc_unlock_device()
- char/vfc_dev.c: vfc_captstat_reset()
- char/vfc_dev.c: vfc_memptr_reset()
- char/vfc_dev.c: vfc_csr_init()
- char/vfc_dev.c: vfc_saa9051_init()
- char/vfc_dev.c: init_vfc_hw()
- char/vfc_dev.c: init_vfc_devstruct()
- char/vfc_dev.c: init_vfc_device()
- char/vfc_dev.c: vfc_get_dev_ptr()
- char/vfc_dev.c: vfc_capture_start()
- char/vfc_dev.c: vfc_capture_poll()
- char/vfc_dev.c: vfc_port_change_ioctl()
- char/vfc_dev.c: vfc_set_video_ioctl()
- char/vfc_dev.c: vfc_get_video_ioctl()
- char/vfc_i2c.c: vfc_i2c_wait_for_bus()
- char/vfc_i2c.c: vfc_i2c_wait_for_pin()
- char/vfc_i2c.c: vfc_i2c_xmit_addr()
- char/vfc_i2c.c: vfc_i2c_xmit_byte()
- char/vfc_i2c.c: vfc_i2c_recv_byte()
- dvma.c: init_one_dvma()
- remove an unused variable from a function:
- char/uctrl.c: ts102_uctrl_init()
- remove the following unused and empty function:
- char/uctrl.c: uctrl_set_video()
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/sbus/char/uctrl.c | 16 | ||||
-rw-r--r-- | drivers/sbus/char/vfc.h | 4 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 39 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_i2c.c | 12 | ||||
-rw-r--r-- | drivers/sbus/dvma.c | 2 |
5 files changed, 33 insertions, 40 deletions
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 513ba61ae966..777637594acd 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c | |||
@@ -195,8 +195,8 @@ struct uctrl_driver { | |||
195 | 195 | ||
196 | static struct uctrl_driver drv; | 196 | static struct uctrl_driver drv; |
197 | 197 | ||
198 | void uctrl_get_event_status(void); | 198 | static void uctrl_get_event_status(void); |
199 | void uctrl_get_external_status(void); | 199 | static void uctrl_get_external_status(void); |
200 | 200 | ||
201 | static int | 201 | static int |
202 | uctrl_ioctl(struct inode *inode, struct file *file, | 202 | uctrl_ioctl(struct inode *inode, struct file *file, |
@@ -266,12 +266,6 @@ static struct miscdevice uctrl_dev = { | |||
266 | driver->regs->uctrl_stat = UCTRL_STAT_RXNE_STA; \ | 266 | driver->regs->uctrl_stat = UCTRL_STAT_RXNE_STA; \ |
267 | } | 267 | } |
268 | 268 | ||
269 | void uctrl_set_video(int status) | ||
270 | { | ||
271 | struct uctrl_driver *driver = &drv; | ||
272 | |||
273 | } | ||
274 | |||
275 | static void uctrl_do_txn(struct uctrl_txn *txn) | 269 | static void uctrl_do_txn(struct uctrl_txn *txn) |
276 | { | 270 | { |
277 | struct uctrl_driver *driver = &drv; | 271 | struct uctrl_driver *driver = &drv; |
@@ -311,7 +305,7 @@ static void uctrl_do_txn(struct uctrl_txn *txn) | |||
311 | } | 305 | } |
312 | } | 306 | } |
313 | 307 | ||
314 | void uctrl_get_event_status(void) | 308 | static void uctrl_get_event_status(void) |
315 | { | 309 | { |
316 | struct uctrl_driver *driver = &drv; | 310 | struct uctrl_driver *driver = &drv; |
317 | struct uctrl_txn txn; | 311 | struct uctrl_txn txn; |
@@ -331,7 +325,7 @@ void uctrl_get_event_status(void) | |||
331 | dprintk(("ev is %x\n", driver->status.event_status)); | 325 | dprintk(("ev is %x\n", driver->status.event_status)); |
332 | } | 326 | } |
333 | 327 | ||
334 | void uctrl_get_external_status(void) | 328 | static void uctrl_get_external_status(void) |
335 | { | 329 | { |
336 | struct uctrl_driver *driver = &drv; | 330 | struct uctrl_driver *driver = &drv; |
337 | struct uctrl_txn txn; | 331 | struct uctrl_txn txn; |
@@ -363,7 +357,7 @@ void uctrl_get_external_status(void) | |||
363 | static int __init ts102_uctrl_init(void) | 357 | static int __init ts102_uctrl_init(void) |
364 | { | 358 | { |
365 | struct uctrl_driver *driver = &drv; | 359 | struct uctrl_driver *driver = &drv; |
366 | int len, i; | 360 | int len; |
367 | struct linux_prom_irqs tmp_irq[2]; | 361 | struct linux_prom_irqs tmp_irq[2]; |
368 | unsigned int vaddr[2] = { 0, 0 }; | 362 | unsigned int vaddr[2] = { 0, 0 }; |
369 | 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 1f6cb8ae2784..25181bb7d627 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -45,7 +45,7 @@ | |||
45 | #include <asm/vfc_ioctls.h> | 45 | #include <asm/vfc_ioctls.h> |
46 | 46 | ||
47 | static const struct file_operations vfc_fops; | 47 | static const struct file_operations vfc_fops; |
48 | struct vfc_dev **vfc_dev_lst; | 48 | static struct vfc_dev **vfc_dev_lst; |
49 | static char vfcstr[]="vfc"; | 49 | static char vfcstr[]="vfc"; |
50 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | 50 | static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { |
51 | 0x00, 0x64, 0x72, 0x52, | 51 | 0x00, 0x64, 0x72, 0x52, |
@@ -54,18 +54,18 @@ static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | |||
54 | 0x3e | 54 | 0x3e |
55 | }; | 55 | }; |
56 | 56 | ||
57 | void vfc_lock_device(struct vfc_dev *dev) | 57 | static void vfc_lock_device(struct vfc_dev *dev) |
58 | { | 58 | { |
59 | mutex_lock(&dev->device_lock_mtx); | 59 | mutex_lock(&dev->device_lock_mtx); |
60 | } | 60 | } |
61 | 61 | ||
62 | void vfc_unlock_device(struct vfc_dev *dev) | 62 | static void vfc_unlock_device(struct vfc_dev *dev) |
63 | { | 63 | { |
64 | mutex_unlock(&dev->device_lock_mtx); | 64 | mutex_unlock(&dev->device_lock_mtx); |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | void vfc_captstat_reset(struct vfc_dev *dev) | 68 | static void vfc_captstat_reset(struct vfc_dev *dev) |
69 | { | 69 | { |
70 | dev->control_reg |= VFC_CONTROL_CAPTRESET; | 70 | dev->control_reg |= VFC_CONTROL_CAPTRESET; |
71 | sbus_writel(dev->control_reg, &dev->regs->control); | 71 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -75,7 +75,7 @@ void vfc_captstat_reset(struct vfc_dev *dev) | |||
75 | sbus_writel(dev->control_reg, &dev->regs->control); | 75 | sbus_writel(dev->control_reg, &dev->regs->control); |
76 | } | 76 | } |
77 | 77 | ||
78 | void vfc_memptr_reset(struct vfc_dev *dev) | 78 | static void vfc_memptr_reset(struct vfc_dev *dev) |
79 | { | 79 | { |
80 | dev->control_reg |= VFC_CONTROL_MEMPTR; | 80 | dev->control_reg |= VFC_CONTROL_MEMPTR; |
81 | sbus_writel(dev->control_reg, &dev->regs->control); | 81 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -85,7 +85,7 @@ void vfc_memptr_reset(struct vfc_dev *dev) | |||
85 | sbus_writel(dev->control_reg, &dev->regs->control); | 85 | sbus_writel(dev->control_reg, &dev->regs->control); |
86 | } | 86 | } |
87 | 87 | ||
88 | int vfc_csr_init(struct vfc_dev *dev) | 88 | static int vfc_csr_init(struct vfc_dev *dev) |
89 | { | 89 | { |
90 | dev->control_reg = 0x80000000; | 90 | dev->control_reg = 0x80000000; |
91 | sbus_writel(dev->control_reg, &dev->regs->control); | 91 | sbus_writel(dev->control_reg, &dev->regs->control); |
@@ -107,7 +107,7 @@ int vfc_csr_init(struct vfc_dev *dev) | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | int vfc_saa9051_init(struct vfc_dev *dev) | 110 | static int vfc_saa9051_init(struct vfc_dev *dev) |
111 | { | 111 | { |
112 | int i; | 112 | int i; |
113 | 113 | ||
@@ -119,7 +119,7 @@ int vfc_saa9051_init(struct vfc_dev *dev) | |||
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
121 | 121 | ||
122 | int init_vfc_hw(struct vfc_dev *dev) | 122 | static int init_vfc_hw(struct vfc_dev *dev) |
123 | { | 123 | { |
124 | vfc_lock_device(dev); | 124 | vfc_lock_device(dev); |
125 | vfc_csr_init(dev); | 125 | vfc_csr_init(dev); |
@@ -132,7 +132,7 @@ int init_vfc_hw(struct vfc_dev *dev) | |||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | int init_vfc_devstruct(struct vfc_dev *dev, int instance) | 135 | static int init_vfc_devstruct(struct vfc_dev *dev, int instance) |
136 | { | 136 | { |
137 | dev->instance=instance; | 137 | dev->instance=instance; |
138 | mutex_init(&dev->device_lock_mtx); | 138 | mutex_init(&dev->device_lock_mtx); |
@@ -141,7 +141,8 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) | |||
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |
143 | 143 | ||
144 | 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) | ||
145 | { | 146 | { |
146 | if(dev == NULL) { | 147 | if(dev == NULL) { |
147 | printk(KERN_ERR "VFC: Bogus pointer passed\n"); | 148 | printk(KERN_ERR "VFC: Bogus pointer passed\n"); |
@@ -168,7 +169,7 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) | |||
168 | } | 169 | } |
169 | 170 | ||
170 | 171 | ||
171 | struct vfc_dev *vfc_get_dev_ptr(int instance) | 172 | static struct vfc_dev *vfc_get_dev_ptr(int instance) |
172 | { | 173 | { |
173 | return vfc_dev_lst[instance]; | 174 | return vfc_dev_lst[instance]; |
174 | } | 175 | } |
@@ -292,7 +293,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) | |||
292 | return 0; | 293 | return 0; |
293 | } | 294 | } |
294 | 295 | ||
295 | int vfc_capture_start(struct vfc_dev *dev) | 296 | static int vfc_capture_start(struct vfc_dev *dev) |
296 | { | 297 | { |
297 | vfc_captstat_reset(dev); | 298 | vfc_captstat_reset(dev); |
298 | dev->control_reg = sbus_readl(&dev->regs->control); | 299 | dev->control_reg = sbus_readl(&dev->regs->control); |
@@ -314,7 +315,7 @@ int vfc_capture_start(struct vfc_dev *dev) | |||
314 | return 0; | 315 | return 0; |
315 | } | 316 | } |
316 | 317 | ||
317 | int vfc_capture_poll(struct vfc_dev *dev) | 318 | static int vfc_capture_poll(struct vfc_dev *dev) |
318 | { | 319 | { |
319 | int timeout = 1000; | 320 | int timeout = 1000; |
320 | 321 | ||
@@ -390,8 +391,8 @@ static int vfc_set_control_ioctl(struct inode *inode, struct file *file, | |||
390 | } | 391 | } |
391 | 392 | ||
392 | 393 | ||
393 | int vfc_port_change_ioctl(struct inode *inode, struct file *file, | 394 | static int vfc_port_change_ioctl(struct inode *inode, struct file *file, |
394 | struct vfc_dev *dev, unsigned long arg) | 395 | struct vfc_dev *dev, unsigned long arg) |
395 | { | 396 | { |
396 | int ret = 0; | 397 | int ret = 0; |
397 | int cmd; | 398 | int cmd; |
@@ -460,8 +461,8 @@ int vfc_port_change_ioctl(struct inode *inode, struct file *file, | |||
460 | return ret; | 461 | return ret; |
461 | } | 462 | } |
462 | 463 | ||
463 | int vfc_set_video_ioctl(struct inode *inode, struct file *file, | 464 | static int vfc_set_video_ioctl(struct inode *inode, struct file *file, |
464 | struct vfc_dev *dev, unsigned long arg) | 465 | struct vfc_dev *dev, unsigned long arg) |
465 | { | 466 | { |
466 | int ret = 0; | 467 | int ret = 0; |
467 | int cmd; | 468 | int cmd; |
@@ -511,8 +512,8 @@ int vfc_set_video_ioctl(struct inode *inode, struct file *file, | |||
511 | return ret; | 512 | return ret; |
512 | } | 513 | } |
513 | 514 | ||
514 | int vfc_get_video_ioctl(struct inode *inode, struct file *file, | 515 | static int vfc_get_video_ioctl(struct inode *inode, struct file *file, |
515 | struct vfc_dev *dev, unsigned long arg) | 516 | struct vfc_dev *dev, unsigned long arg) |
516 | { | 517 | { |
517 | int ret = 0; | 518 | int ret = 0; |
518 | 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 | ||
diff --git a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c index 57e1526746a2..ab0d2de3324c 100644 --- a/drivers/sbus/dvma.c +++ b/drivers/sbus/dvma.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | struct sbus_dma *dma_chain; | 17 | struct sbus_dma *dma_chain; |
18 | 18 | ||
19 | void __init init_one_dvma(struct sbus_dma *dma, int num_dma) | 19 | static void __init init_one_dvma(struct sbus_dma *dma, int num_dma) |
20 | { | 20 | { |
21 | printk("dma%d: ", num_dma); | 21 | printk("dma%d: ", num_dma); |
22 | 22 | ||