]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: s626: remove unnecessary checks of 'devpriv->base_addr'
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 24 Sep 2012 20:23:40 +0000 (13:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 16:37:30 +0000 (09:37 -0700)
'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>
drivers/staging/comedi/drivers/s626.c

index 6f6c808509cde024fe2d56581f886a05c0bde88f..a9d78c72140306e6ba067f7555560f29e28e4da0 100644 (file)
@@ -2465,43 +2465,40 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
        if (!devpriv->base_addr)
                return -ENOMEM;
 
-       if (devpriv->base_addr) {
-               /* disable master interrupt */
-               writel(0, devpriv->base_addr + P_IER);
+       /* disable master interrupt */
+       writel(0, devpriv->base_addr + P_IER);
 
-               /* soft reset */
-               writel(MC1_SOFT_RESET, devpriv->base_addr + P_MC1);
+       /* soft reset */
+       writel(MC1_SOFT_RESET, devpriv->base_addr + P_MC1);
 
-               /* DMA FIXME DMA// */
+       /* DMA FIXME DMA// */
 
-               /* adc buffer allocation */
-               devpriv->allocatedBuf = 0;
+       /* adc buffer allocation */
+       devpriv->allocatedBuf = 0;
 
-               devpriv->ANABuf.LogicalBase =
-                   pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
+       devpriv->ANABuf.LogicalBase =
+               pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
 
-               if (devpriv->ANABuf.LogicalBase == NULL) {
-                       printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
-                       return -ENOMEM;
-               }
-
-               devpriv->ANABuf.PhysicalBase = appdma;
+       if (devpriv->ANABuf.LogicalBase == NULL) {
+               printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
+               return -ENOMEM;
+       }
 
-               devpriv->allocatedBuf++;
+       devpriv->ANABuf.PhysicalBase = appdma;
 
-               devpriv->RPSBuf.LogicalBase =
-                   pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
+       devpriv->allocatedBuf++;
 
-               if (devpriv->RPSBuf.LogicalBase == NULL) {
-                       printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
-                       return -ENOMEM;
-               }
+       devpriv->RPSBuf.LogicalBase =
+               pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
 
-               devpriv->RPSBuf.PhysicalBase = appdma;
+       if (devpriv->RPSBuf.LogicalBase == NULL) {
+               printk(KERN_ERR "s626_attach: DMA Memory mapping error\n");
+               return -ENOMEM;
+       }
 
-               devpriv->allocatedBuf++;
+       devpriv->RPSBuf.PhysicalBase = appdma;
 
-       }
+       devpriv->allocatedBuf++;
 
        ret = comedi_alloc_subdevices(dev, 6);
        if (ret)
@@ -2599,7 +2596,7 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
        /* stop ai_command */
        devpriv->ai_cmd_running = 0;
 
-       if (devpriv->base_addr && (devpriv->allocatedBuf == 2)) {
+       if (devpriv->allocatedBuf == 2) {
                dma_addr_t pPhysBuf;
                uint16_t chan;