aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-06-05 14:44:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 00:38:17 -0400
commit960681450f8b572f230a8c3661dcc34f39fcc38e (patch)
treeba38375e57ecdfe2d97bd51b275f2fadaba51a40
parent908f5162ca59ed46a928e8416db159777d432e77 (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.c16
-rw-r--r--drivers/sbus/char/vfc.h4
-rw-r--r--drivers/sbus/char/vfc_dev.c39
-rw-r--r--drivers/sbus/char/vfc_i2c.c12
-rw-r--r--drivers/sbus/dvma.c2
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
196static struct uctrl_driver drv; 196static struct uctrl_driver drv;
197 197
198void uctrl_get_event_status(void); 198static void uctrl_get_event_status(void);
199void uctrl_get_external_status(void); 199static void uctrl_get_external_status(void);
200 200
201static int 201static int
202uctrl_ioctl(struct inode *inode, struct file *file, 202uctrl_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
269void uctrl_set_video(int status)
270{
271 struct uctrl_driver *driver = &drv;
272
273}
274
275static void uctrl_do_txn(struct uctrl_txn *txn) 269static 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
314void uctrl_get_event_status(void) 308static 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
334void uctrl_get_external_status(void) 328static 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)
363static int __init ts102_uctrl_init(void) 357static 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
136extern struct vfc_dev **vfc_dev_lst;
137
138void captstat_reset(struct vfc_dev *); 136void captstat_reset(struct vfc_dev *);
139void memptr_reset(struct vfc_dev *); 137void memptr_reset(struct vfc_dev *);
140 138
@@ -145,8 +143,6 @@ int vfc_i2c_sendbuf(struct vfc_dev *, unsigned char, char *, int) ;
145int vfc_i2c_recvbuf(struct vfc_dev *, unsigned char, char *, int) ; 143int vfc_i2c_recvbuf(struct vfc_dev *, unsigned char, char *, int) ;
146int vfc_i2c_reset_bus(struct vfc_dev *); 144int vfc_i2c_reset_bus(struct vfc_dev *);
147int vfc_init_i2c_bus(struct vfc_dev *); 145int vfc_init_i2c_bus(struct vfc_dev *);
148void vfc_lock_device(struct vfc_dev *);
149void 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
47static const struct file_operations vfc_fops; 47static const struct file_operations vfc_fops;
48struct vfc_dev **vfc_dev_lst; 48static struct vfc_dev **vfc_dev_lst;
49static char vfcstr[]="vfc"; 49static char vfcstr[]="vfc";
50static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { 50static 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
57void vfc_lock_device(struct vfc_dev *dev) 57static 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
62void vfc_unlock_device(struct vfc_dev *dev) 62static 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
68void vfc_captstat_reset(struct vfc_dev *dev) 68static 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
78void vfc_memptr_reset(struct vfc_dev *dev) 78static 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
88int vfc_csr_init(struct vfc_dev *dev) 88static 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
110int vfc_saa9051_init(struct vfc_dev *dev) 110static 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
122int init_vfc_hw(struct vfc_dev *dev) 122static 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
135int init_vfc_devstruct(struct vfc_dev *dev, int instance) 135static 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
144int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) 144static 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
171struct vfc_dev *vfc_get_dev_ptr(int instance) 172static 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
295int vfc_capture_start(struct vfc_dev *dev) 296static 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
317int vfc_capture_poll(struct vfc_dev *dev) 318static 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
393int vfc_port_change_ioctl(struct inode *inode, struct file *file, 394static 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
463int vfc_set_video_ioctl(struct inode *inode, struct file *file, 464static 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
514int vfc_get_video_ioctl(struct inode *inode, struct file *file, 515static 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
117int vfc_i2c_wait_for_bus(struct vfc_dev *dev) 117static 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
129int vfc_i2c_wait_for_pin(struct vfc_dev *dev, int ack) 129static 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)
147int vfc_i2c_xmit_addr(struct vfc_dev *dev, unsigned char addr, char mode) 147static 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
198int vfc_i2c_xmit_byte(struct vfc_dev *dev,unsigned char *byte) 199static 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
221int vfc_i2c_recv_byte(struct vfc_dev *dev, unsigned char *byte, int last) 222static 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
17struct sbus_dma *dma_chain; 17struct sbus_dma *dma_chain;
18 18
19void __init init_one_dvma(struct sbus_dma *dma, int num_dma) 19static 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