aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-24 16:23:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-26 12:37:30 -0400
commit97d87e00e3d6bdc8f3de606dd7cc5aa149709435 (patch)
tree4d7963a08535da2b7ecbecbd600dd471667660ce
parent4f6c7bf992bc6f1bbf38b08e9b3c8a21865888f2 (diff)
staging: comedi: s626: remove unnecessary checks of 'devpriv->base_addr'
'devpriv->base_addr' is valid from this point on in the attach_pci() function. Remove the unnecessary checks. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/s626.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 6f6c808509cd..a9d78c721403 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -2465,43 +2465,40 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
2465 if (!devpriv->base_addr) 2465 if (!devpriv->base_addr)
2466 return -ENOMEM; 2466 return -ENOMEM;
2467 2467
2468 if (devpriv->base_addr) { 2468 /* disable master interrupt */
2469 /* disable master interrupt */ 2469 writel(0, devpriv->base_addr + P_IER);
2470 writel(0, devpriv->base_addr + P_IER);
2471 2470
2472 /* soft reset */ 2471 /* soft reset */
2473 writel(MC1_SOFT_RESET, devpriv->base_addr + P_MC1); 2472 writel(MC1_SOFT_RESET, devpriv->base_addr + P_MC1);
2474 2473
2475 /* DMA FIXME DMA// */ 2474 /* DMA FIXME DMA// */
2476 2475
2477 /* adc buffer allocation */ 2476 /* adc buffer allocation */
2478 devpriv->allocatedBuf = 0; 2477 devpriv->allocatedBuf = 0;
2479 2478
2480 devpriv->ANABuf.LogicalBase = 2479 devpriv->ANABuf.LogicalBase =
2481 pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma); 2480 pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
2482 2481
2483 if (devpriv->ANABuf.LogicalBase == NULL) { 2482 if (devpriv->ANABuf.LogicalBase == NULL) {
2484 printk(KERN_ERR "s626_attach: DMA Memory mapping error\n"); 2483 printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
2485 return -ENOMEM; 2484 return -ENOMEM;
2486 } 2485 }
2487
2488 devpriv->ANABuf.PhysicalBase = appdma;
2489 2486
2490 devpriv->allocatedBuf++; 2487 devpriv->ANABuf.PhysicalBase = appdma;
2491 2488
2492 devpriv->RPSBuf.LogicalBase = 2489 devpriv->allocatedBuf++;
2493 pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
2494 2490
2495 if (devpriv->RPSBuf.LogicalBase == NULL) { 2491 devpriv->RPSBuf.LogicalBase =
2496 printk(KERN_ERR "s626_attach: DMA Memory mapping error\n"); 2492 pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
2497 return -ENOMEM;
2498 }
2499 2493
2500 devpriv->RPSBuf.PhysicalBase = appdma; 2494 if (devpriv->RPSBuf.LogicalBase == NULL) {
2495 printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
2496 return -ENOMEM;
2497 }
2501 2498
2502 devpriv->allocatedBuf++; 2499 devpriv->RPSBuf.PhysicalBase = appdma;
2503 2500
2504 } 2501 devpriv->allocatedBuf++;
2505 2502
2506 ret = comedi_alloc_subdevices(dev, 6); 2503 ret = comedi_alloc_subdevices(dev, 6);
2507 if (ret) 2504 if (ret)
@@ -2599,7 +2596,7 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
2599 /* stop ai_command */ 2596 /* stop ai_command */
2600 devpriv->ai_cmd_running = 0; 2597 devpriv->ai_cmd_running = 0;
2601 2598
2602 if (devpriv->base_addr && (devpriv->allocatedBuf == 2)) { 2599 if (devpriv->allocatedBuf == 2) {
2603 dma_addr_t pPhysBuf; 2600 dma_addr_t pPhysBuf;
2604 uint16_t chan; 2601 uint16_t chan;
2605 2602