aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorRichard Knutsson <ricknu-0@student.ltu.se>2007-02-06 19:52:04 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:35:16 -0500
commite8be02a34a43c88a7666217b186e169a30f1609b (patch)
tree489cf3bd4a296aeac5ff583bf23045800f667ca9 /drivers/media/video
parent7a9ca4a3f99129c2316ee14273ded519630c573d (diff)
V4L/DVB (5197): Convert to generic boolean-values
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/saa5246a.c10
-rw-r--r--drivers/media/video/saa5246a.h9
-rw-r--r--drivers/media/video/saa5249.c41
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c24
-rw-r--r--drivers/media/video/saa7134/saa7134.h6
5 files changed, 37 insertions, 53 deletions
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 76f5f5d49dae..e20aa3612a7c 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -111,7 +111,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
111 for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) 111 for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++)
112 { 112 {
113 memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0])); 113 memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0]));
114 t->is_searching[pgbuf] = FALSE; 114 t->is_searching[pgbuf] = false;
115 } 115 }
116 vd->priv=t; 116 vd->priv=t;
117 117
@@ -198,7 +198,7 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
198 198
199/* Get count number of bytes from I²C-device at address adr, store them in buf. 199/* Get count number of bytes from I²C-device at address adr, store them in buf.
200 * Start & stop handshaking is done by this routine, ack will be sent after the 200 * Start & stop handshaking is done by this routine, ack will be sent after the
201 * last byte to inhibit further sending of data. If uaccess is TRUE, data is 201 * last byte to inhibit further sending of data. If uaccess is 'true', data is
202 * written to user-space with put_user. Returns -1 if I²C-device didn't send 202 * written to user-space with put_user. Returns -1 if I²C-device didn't send
203 * acknowledge, 0 otherwise 203 * acknowledge, 0 otherwise
204 */ 204 */
@@ -338,7 +338,7 @@ static int saa5246a_request_page(struct saa5246a_device *t,
338 return -EIO; 338 return -EIO;
339 } 339 }
340 340
341 t->is_searching[req->pgbuf] = TRUE; 341 t->is_searching[req->pgbuf] = true;
342 return 0; 342 return 0;
343} 343}
344 344
@@ -452,7 +452,7 @@ static inline int saa5246a_get_status(struct saa5246a_device *t,
452 } 452 }
453 } 453 }
454 if (!info->hamming && !info->notfound) 454 if (!info->hamming && !info->notfound)
455 t->is_searching[dau_no] = FALSE; 455 t->is_searching[dau_no] = false;
456 return 0; 456 return 0;
457} 457}
458 458
@@ -564,7 +564,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
564 { 564 {
565 return -EIO; 565 return -EIO;
566 } 566 }
567 t->is_searching[dau_no] = FALSE; 567 t->is_searching[dau_no] = false;
568 return 0; 568 return 0;
569} 569}
570 570
diff --git a/drivers/media/video/saa5246a.h b/drivers/media/video/saa5246a.h
index 7b91112304e0..64394c036c60 100644
--- a/drivers/media/video/saa5246a.h
+++ b/drivers/media/video/saa5246a.h
@@ -41,23 +41,18 @@
41#define POS_HEADER_START 7 41#define POS_HEADER_START 7
42#define POS_HEADER_END 31 42#define POS_HEADER_END 31
43 43
44/* Returns TRUE if the part of the videotext page described with req contains 44/* Returns 'true' if the part of the videotext page described with req contains
45 (at least parts of) the time field */ 45 (at least parts of) the time field */
46#define REQ_CONTAINS_TIME(p_req) \ 46#define REQ_CONTAINS_TIME(p_req) \
47 ((p_req)->start <= POS_TIME_END && \ 47 ((p_req)->start <= POS_TIME_END && \
48 (p_req)->end >= POS_TIME_START) 48 (p_req)->end >= POS_TIME_START)
49 49
50/* Returns TRUE if the part of the videotext page described with req contains 50/* Returns 'true' if the part of the videotext page described with req contains
51 (at least parts of) the page header */ 51 (at least parts of) the page header */
52#define REQ_CONTAINS_HEADER(p_req) \ 52#define REQ_CONTAINS_HEADER(p_req) \
53 ((p_req)->start <= POS_HEADER_END && \ 53 ((p_req)->start <= POS_HEADER_END && \
54 (p_req)->end >= POS_HEADER_START) 54 (p_req)->end >= POS_HEADER_START)
55 55
56#ifndef FALSE
57#define FALSE 0
58#define TRUE 1
59#endif
60
61/*****************************************************************************/ 56/*****************************************************************************/
62/* Mode register numbers of the SAA5246A */ 57/* Mode register numbers of the SAA5246A */
63/*****************************************************************************/ 58/*****************************************************************************/
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 3e84737878a8..f2a2f34cd626 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -124,11 +124,6 @@ struct saa5249_device
124 124
125/* General defines and debugging support */ 125/* General defines and debugging support */
126 126
127#ifndef FALSE
128#define FALSE 0
129#define TRUE 1
130#endif
131
132#define RESCHED do { cond_resched(); } while(0) 127#define RESCHED do { cond_resched(); } while(0)
133 128
134static struct video_device saa_template; /* Declared near bottom */ 129static struct video_device saa_template; /* Declared near bottom */
@@ -183,9 +178,9 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
183 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); 178 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs));
184 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); 179 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat));
185 t->vdau[pgbuf].expire = 0; 180 t->vdau[pgbuf].expire = 0;
186 t->vdau[pgbuf].clrfound = TRUE; 181 t->vdau[pgbuf].clrfound = true;
187 t->vdau[pgbuf].stopped = TRUE; 182 t->vdau[pgbuf].stopped = true;
188 t->is_searching[pgbuf] = FALSE; 183 t->is_searching[pgbuf] = false;
189 } 184 }
190 vd->priv=t; 185 vd->priv=t;
191 186
@@ -298,7 +293,7 @@ static int i2c_senddata(struct saa5249_device *t, ...)
298 293
299/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop 294/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop
300 * handshaking is done by this routine, ack will be sent after the last byte to inhibit further 295 * handshaking is done by this routine, ack will be sent after the last byte to inhibit further
301 * sending of data. If uaccess is TRUE, data is written to user-space with put_user. 296 * sending of data. If uaccess is 'true', data is written to user-space with put_user.
302 * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise 297 * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise
303 */ 298 */
304 299
@@ -317,7 +312,7 @@ static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
317static int do_saa5249_ioctl(struct inode *inode, struct file *file, 312static int do_saa5249_ioctl(struct inode *inode, struct file *file,
318 unsigned int cmd, void *arg) 313 unsigned int cmd, void *arg)
319{ 314{
320 static int virtual_mode = FALSE; 315 static int virtual_mode = false;
321 struct video_device *vd = video_devdata(file); 316 struct video_device *vd = video_devdata(file);
322 struct saa5249_device *t=vd->priv; 317 struct saa5249_device *t=vd->priv;
323 318
@@ -340,7 +335,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
340 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 335 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
341 return -EINVAL; 336 return -EINVAL;
342 memset(t->vdau[req->pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); 337 memset(t->vdau[req->pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf));
343 t->vdau[req->pgbuf].clrfound = TRUE; 338 t->vdau[req->pgbuf].clrfound = true;
344 return 0; 339 return 0;
345 } 340 }
346 341
@@ -350,7 +345,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
350 345
351 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 346 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
352 return -EINVAL; 347 return -EINVAL;
353 t->vdau[req->pgbuf].clrfound = TRUE; 348 t->vdau[req->pgbuf].clrfound = true;
354 return 0; 349 return 0;
355 } 350 }
356 351
@@ -376,9 +371,9 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
376 t->vdau[req->pgbuf].sregs[4] = (req->pagemask & HR_UNIT ? 0x10 : 0) | (req->hour & 0xf); 371 t->vdau[req->pgbuf].sregs[4] = (req->pagemask & HR_UNIT ? 0x10 : 0) | (req->hour & 0xf);
377 t->vdau[req->pgbuf].sregs[5] = (req->pagemask & MIN_TEN ? 0x10 : 0) | (req->minute / 0x10); 372 t->vdau[req->pgbuf].sregs[5] = (req->pagemask & MIN_TEN ? 0x10 : 0) | (req->minute / 0x10);
378 t->vdau[req->pgbuf].sregs[6] = (req->pagemask & MIN_UNIT ? 0x10 : 0) | (req->minute & 0xf); 373 t->vdau[req->pgbuf].sregs[6] = (req->pagemask & MIN_UNIT ? 0x10 : 0) | (req->minute & 0xf);
379 t->vdau[req->pgbuf].stopped = FALSE; 374 t->vdau[req->pgbuf].stopped = false;
380 t->vdau[req->pgbuf].clrfound = TRUE; 375 t->vdau[req->pgbuf].clrfound = true;
381 t->is_searching[req->pgbuf] = TRUE; 376 t->is_searching[req->pgbuf] = true;
382 return 0; 377 return 0;
383 } 378 }
384 379
@@ -430,7 +425,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
430 i2c_getdata(t, 40, t->vdau[req->pgbuf].pgbuf + VTX_PAGESIZE + 23 * 40)) 425 i2c_getdata(t, 40, t->vdau[req->pgbuf].pgbuf + VTX_PAGESIZE + 23 * 40))
431 return -EIO; 426 return -EIO;
432 } 427 }
433 t->vdau[req->pgbuf].clrfound = FALSE; 428 t->vdau[req->pgbuf].clrfound = false;
434 memcpy(t->vdau[req->pgbuf].laststat, infobits, sizeof(infobits)); 429 memcpy(t->vdau[req->pgbuf].laststat, infobits, sizeof(infobits));
435 } 430 }
436 else 431 else
@@ -474,7 +469,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
474 return -EFAULT; 469 return -EFAULT;
475 if (!info.hamming && !info.notfound) 470 if (!info.hamming && !info.notfound)
476 { 471 {
477 t->is_searching[req->pgbuf] = FALSE; 472 t->is_searching[req->pgbuf] = false;
478 } 473 }
479 return 0; 474 return 0;
480 } 475 }
@@ -530,8 +525,8 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
530 525
531 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 526 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS)
532 return -EINVAL; 527 return -EINVAL;
533 t->vdau[req->pgbuf].stopped = TRUE; 528 t->vdau[req->pgbuf].stopped = true;
534 t->is_searching[req->pgbuf] = FALSE; 529 t->is_searching[req->pgbuf] = false;
535 return 0; 530 return 0;
536 } 531 }
537 532
@@ -660,11 +655,11 @@ static int saa5249_open(struct inode *inode, struct file *file)
660 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); 655 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs));
661 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); 656 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat));
662 t->vdau[pgbuf].expire = 0; 657 t->vdau[pgbuf].expire = 0;
663 t->vdau[pgbuf].clrfound = TRUE; 658 t->vdau[pgbuf].clrfound = true;
664 t->vdau[pgbuf].stopped = TRUE; 659 t->vdau[pgbuf].stopped = true;
665 t->is_searching[pgbuf] = FALSE; 660 t->is_searching[pgbuf] = false;
666 } 661 }
667 t->virtual_mode=FALSE; 662 t->virtual_mode = false;
668 return 0; 663 return 0;
669 664
670 fail: 665 fail:
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index 6f9fe86fed98..cce8da6a4f94 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -120,9 +120,9 @@ static inline int i2c_is_error(enum i2c_status status)
120 case ARB_LOST: 120 case ARB_LOST:
121 case SEQ_ERR: 121 case SEQ_ERR:
122 case ST_ERR: 122 case ST_ERR:
123 return TRUE; 123 return true;
124 default: 124 default:
125 return FALSE; 125 return false;
126 } 126 }
127} 127}
128 128
@@ -131,9 +131,9 @@ static inline int i2c_is_idle(enum i2c_status status)
131 switch (status) { 131 switch (status) {
132 case IDLE: 132 case IDLE:
133 case DONE_STOP: 133 case DONE_STOP:
134 return TRUE; 134 return true;
135 default: 135 default:
136 return FALSE; 136 return false;
137 } 137 }
138} 138}
139 139
@@ -141,9 +141,9 @@ static inline int i2c_is_busy(enum i2c_status status)
141{ 141{
142 switch (status) { 142 switch (status) {
143 case BUSY: 143 case BUSY:
144 return TRUE; 144 return true;
145 default: 145 default:
146 return FALSE; 146 return false;
147 } 147 }
148} 148}
149 149
@@ -159,8 +159,8 @@ static int i2c_is_busy_wait(struct saa7134_dev *dev)
159 saa_wait(I2C_WAIT_DELAY); 159 saa_wait(I2C_WAIT_DELAY);
160 } 160 }
161 if (I2C_WAIT_RETRY == count) 161 if (I2C_WAIT_RETRY == count)
162 return FALSE; 162 return false;
163 return TRUE; 163 return true;
164} 164}
165 165
166static int i2c_reset(struct saa7134_dev *dev) 166static int i2c_reset(struct saa7134_dev *dev)
@@ -171,7 +171,7 @@ static int i2c_reset(struct saa7134_dev *dev)
171 d2printk(KERN_DEBUG "%s: i2c reset\n",dev->name); 171 d2printk(KERN_DEBUG "%s: i2c reset\n",dev->name);
172 status = i2c_get_status(dev); 172 status = i2c_get_status(dev);
173 if (!i2c_is_error(status)) 173 if (!i2c_is_error(status))
174 return TRUE; 174 return true;
175 i2c_set_status(dev,status); 175 i2c_set_status(dev,status);
176 176
177 for (count = 0; count < I2C_WAIT_RETRY; count++) { 177 for (count = 0; count < I2C_WAIT_RETRY; count++) {
@@ -181,13 +181,13 @@ static int i2c_reset(struct saa7134_dev *dev)
181 udelay(I2C_WAIT_DELAY); 181 udelay(I2C_WAIT_DELAY);
182 } 182 }
183 if (I2C_WAIT_RETRY == count) 183 if (I2C_WAIT_RETRY == count)
184 return FALSE; 184 return false;
185 185
186 if (!i2c_is_idle(status)) 186 if (!i2c_is_idle(status))
187 return FALSE; 187 return false;
188 188
189 i2c_set_attr(dev,NOP); 189 i2c_set_attr(dev,NOP);
190 return TRUE; 190 return true;
191} 191}
192 192
193static inline int i2c_send_byte(struct saa7134_dev *dev, 193static inline int i2c_send_byte(struct saa7134_dev *dev,
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 2ad859bda2e3..b3e3957c89b5 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -45,12 +45,6 @@
45#include <media/video-buf-dvb.h> 45#include <media/video-buf-dvb.h>
46#endif 46#endif
47 47
48#ifndef TRUE
49# define TRUE (1==1)
50#endif
51#ifndef FALSE
52# define FALSE (1==0)
53#endif
54#define UNSET (-1U) 48#define UNSET (-1U)
55 49
56/* ----------------------------------------------------------- */ 50/* ----------------------------------------------------------- */