aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Gelmini <andrea.gelmini@gelma.net>2010-02-26 04:15:10 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-03 19:43:06 -0500
commitfa93e19dcf8600c87a60160735b1065cd4bb4dbb (patch)
tree08f97002e58b85dfaa5f5286f86fbbab0803be18
parent20962c10c19862c58c03eec2434279a5d104c40e (diff)
Staging: comedi: dt2801.c: Checkpatch cleanup
ERROR: code indent should use tabs where possible + 0 = [-10,10]$ ERROR: code indent should use tabs where possible + 0 = [-10,10]$ WARNING: braces {} are not necessary for single statement blocks + if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY)) { + return stat; + } WARNING: braces {} are not necessary for single statement blocks + if (stat & DT_S_COMPOSITE_ERROR) { + return stat; + } WARNING: braces {} are not necessary for single statement blocks + if (stat & DT_S_READY) { + return 0; + } WARNING: braces {} are not necessary for single statement blocks + if (stat & DT_S_COMPOSITE_ERROR) { + return stat; + } WARNING: braces {} are not necessary for single statement blocks + if (stat & DT_S_READY) { + return 0; + } WARNING: braces {} are not necessary for single statement blocks + if (!(stat & DT_S_READY)) { + printk("dt2801: !ready in dt2801_writecmd(), ignoring\n"); + } WARNING: braces {} are not necessary for single statement blocks + if (!timeout) { + printk("dt2801: timeout 1 status=0x%02x\n", stat); + } WARNING: braces {} are not necessary for single statement blocks + if (!timeout) { + printk("dt2801: timeout 2 status=0x%02x\n", stat); + } WARNING: braces {} are not necessary for any arm of this statement + if (stat == -ETIME) { [...] + } else { [...] Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/comedi/drivers/dt2801.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c
index 7b9af5d755e0..3f365aee4822 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -18,10 +18,10 @@ Configuration options:
18 [1] - unused 18 [1] - unused
19 [2] - A/D reference 0=differential, 1=single-ended 19 [2] - A/D reference 0=differential, 1=single-ended
20 [3] - A/D range 20 [3] - A/D range
21 0 = [-10,10] 21 0 = [-10, 10]
22 1 = [0,10] 22 1 = [0,10]
23 [4] - D/A 0 range 23 [4] - D/A 0 range
24 0 = [-10,10] 24 0 = [-10, 10]
25 1 = [-5,5] 25 1 = [-5,5]
26 2 = [-2.5,2.5] 26 2 = [-2.5,2.5]
27 3 = [0,10] 27 3 = [0,10]
@@ -279,9 +279,8 @@ static int dt2801_readdata(struct comedi_device *dev, int *data)
279 279
280 do { 280 do {
281 stat = inb_p(dev->iobase + DT2801_STATUS); 281 stat = inb_p(dev->iobase + DT2801_STATUS);
282 if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY)) { 282 if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY))
283 return stat; 283 return stat;
284 }
285 if (stat & DT_S_DATA_OUT_READY) { 284 if (stat & DT_S_DATA_OUT_READY) {
286 *data = inb_p(dev->iobase + DT2801_DATA); 285 *data = inb_p(dev->iobase + DT2801_DATA);
287 return 0; 286 return 0;
@@ -315,9 +314,8 @@ static int dt2801_writedata(struct comedi_device *dev, unsigned int data)
315 do { 314 do {
316 stat = inb_p(dev->iobase + DT2801_STATUS); 315 stat = inb_p(dev->iobase + DT2801_STATUS);
317 316
318 if (stat & DT_S_COMPOSITE_ERROR) { 317 if (stat & DT_S_COMPOSITE_ERROR)
319 return stat; 318 return stat;
320 }
321 if (!(stat & DT_S_DATA_IN_FULL)) { 319 if (!(stat & DT_S_DATA_IN_FULL)) {
322 outb_p(data & 0xff, dev->iobase + DT2801_DATA); 320 outb_p(data & 0xff, dev->iobase + DT2801_DATA);
323 return 0; 321 return 0;
@@ -354,18 +352,15 @@ static int dt2801_wait_for_ready(struct comedi_device *dev)
354 int stat; 352 int stat;
355 353
356 stat = inb_p(dev->iobase + DT2801_STATUS); 354 stat = inb_p(dev->iobase + DT2801_STATUS);
357 if (stat & DT_S_READY) { 355 if (stat & DT_S_READY)
358 return 0; 356 return 0;
359 }
360 do { 357 do {
361 stat = inb_p(dev->iobase + DT2801_STATUS); 358 stat = inb_p(dev->iobase + DT2801_STATUS);
362 359
363 if (stat & DT_S_COMPOSITE_ERROR) { 360 if (stat & DT_S_COMPOSITE_ERROR)
364 return stat; 361 return stat;
365 } 362 if (stat & DT_S_READY)
366 if (stat & DT_S_READY) {
367 return 0; 363 return 0;
368 }
369 } while (--timeout > 0); 364 } while (--timeout > 0);
370 365
371 return -ETIME; 366 return -ETIME;
@@ -382,9 +377,8 @@ static int dt2801_writecmd(struct comedi_device *dev, int command)
382 printk 377 printk
383 ("dt2801: composite-error in dt2801_writecmd(), ignoring\n"); 378 ("dt2801: composite-error in dt2801_writecmd(), ignoring\n");
384 } 379 }
385 if (!(stat & DT_S_READY)) { 380 if (!(stat & DT_S_READY))
386 printk("dt2801: !ready in dt2801_writecmd(), ignoring\n"); 381 printk("dt2801: !ready in dt2801_writecmd(), ignoring\n");
387 }
388 outb_p(command, dev->iobase + DT2801_CMD); 382 outb_p(command, dev->iobase + DT2801_CMD);
389 383
390 return 0; 384 return 0;
@@ -418,9 +412,8 @@ static int dt2801_reset(struct comedi_device *dev)
418 if (stat & DT_S_READY) 412 if (stat & DT_S_READY)
419 break; 413 break;
420 } while (timeout--); 414 } while (timeout--);
421 if (!timeout) { 415 if (!timeout)
422 printk("dt2801: timeout 1 status=0x%02x\n", stat); 416 printk("dt2801: timeout 1 status=0x%02x\n", stat);
423 }
424 417
425 /* printk("dt2801: reading dummy\n"); */ 418 /* printk("dt2801: reading dummy\n"); */
426 /* dt2801_readdata(dev,&board_code); */ 419 /* dt2801_readdata(dev,&board_code); */
@@ -436,9 +429,8 @@ static int dt2801_reset(struct comedi_device *dev)
436 if (stat & DT_S_READY) 429 if (stat & DT_S_READY)
437 break; 430 break;
438 } while (timeout--); 431 } while (timeout--);
439 if (!timeout) { 432 if (!timeout)
440 printk("dt2801: timeout 2 status=0x%02x\n", stat); 433 printk("dt2801: timeout 2 status=0x%02x\n", stat);
441 }
442 434
443 DPRINTK("dt2801: reading code\n"); 435 DPRINTK("dt2801: reading code\n");
444 dt2801_readdata(dev, &board_code); 436 dt2801_readdata(dev, &board_code);
@@ -623,11 +615,10 @@ static int dt2801_detach(struct comedi_device *dev)
623static int dt2801_error(struct comedi_device *dev, int stat) 615static int dt2801_error(struct comedi_device *dev, int stat)
624{ 616{
625 if (stat < 0) { 617 if (stat < 0) {
626 if (stat == -ETIME) { 618 if (stat == -ETIME)
627 printk("dt2801: timeout\n"); 619 printk("dt2801: timeout\n");
628 } else { 620 else
629 printk("dt2801: error %d\n", stat); 621 printk("dt2801: error %d\n", stat);
630 }
631 return stat; 622 return stat;
632 } 623 }
633 printk("dt2801: error status 0x%02x, resetting...\n", stat); 624 printk("dt2801: error status 0x%02x, resetting...\n", stat);