staging: comedi: addi_eeprom: don't pass the eeprom 'type'
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 30 Oct 2012 00:10:14 +0000 (17:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Oct 2012 17:50:15 +0000 (10:50 -0700)
The eeprom 'type' can be found from the boardinfo when needed.
Finding it when needed also makes it clearer what this value is.

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/addi-data/addi_eeprom.c

index 68b85e2925c5c78a3016ab01fad413e02c13d590..5124ac9f1818da33cdb20397e6ac6ec0cb30e442 100644 (file)
@@ -182,10 +182,11 @@ static unsigned short addi_eeprom_readw(unsigned long iobase,
 
 static void addi_eeprom_read_di_info(struct comedi_device *dev,
                                     unsigned long iobase,
-                                    char *type,
                                     unsigned short addr)
 {
+       const struct addi_board *this_board = comedi_board(dev);
        struct addi_private *devpriv = dev->private;
+       char *type = this_board->pc_EepromChip;
        unsigned short tmp;
 
        /* Number of channels */
@@ -202,10 +203,11 @@ static void addi_eeprom_read_di_info(struct comedi_device *dev,
 
 static void addi_eeprom_read_do_info(struct comedi_device *dev,
                                     unsigned long iobase,
-                                    char *type,
                                     unsigned short addr)
 {
+       const struct addi_board *this_board = comedi_board(dev);
        struct addi_private *devpriv = dev->private;
+       char *type = this_board->pc_EepromChip;
        unsigned short tmp;
 
        /* Number of channels */
@@ -217,11 +219,12 @@ static void addi_eeprom_read_do_info(struct comedi_device *dev,
 
 static void addi_eeprom_read_timer_info(struct comedi_device *dev,
                                        unsigned long iobase,
-                                       char *type,
                                        unsigned short addr)
 {
        struct addi_private *devpriv = dev->private;
 #if 0
+       const struct addi_board *this_board = comedi_board(dev);
+       char *type = this_board->pc_EepromChip;
        unsigned short offset = 0;
        unsigned short ntimers;
        unsigned short tmp;
@@ -259,10 +262,11 @@ static void addi_eeprom_read_timer_info(struct comedi_device *dev,
 
 static void addi_eeprom_read_ao_info(struct comedi_device *dev,
                                     unsigned long iobase,
-                                    char *type,
                                     unsigned short addr)
 {
+       const struct addi_board *this_board = comedi_board(dev);
        struct addi_private *devpriv = dev->private;
+       char *type = this_board->pc_EepromChip;
        unsigned short tmp;
 
        /* No of channels for 1st hard component */
@@ -277,11 +281,11 @@ static void addi_eeprom_read_ao_info(struct comedi_device *dev,
 
 static void addi_eeprom_read_ai_info(struct comedi_device *dev,
                                     unsigned long iobase,
-                                    char *type,
                                     unsigned short addr)
 {
        const struct addi_board *this_board = comedi_board(dev);
        struct addi_private *devpriv = dev->private;
+       char *type = this_board->pc_EepromChip;
        unsigned short offset;
        unsigned short tmp;
 
@@ -336,25 +340,25 @@ static void addi_eeprom_read_info(struct comedi_device *dev,
 
                switch (func) {
                case EEPROM_DIGITALINPUT:
-                       addi_eeprom_read_di_info(dev, iobase, type, addr);
+                       addi_eeprom_read_di_info(dev, iobase, addr);
                        break;
 
                case EEPROM_DIGITALOUTPUT:
-                       addi_eeprom_read_do_info(dev, iobase, type, addr);
+                       addi_eeprom_read_do_info(dev, iobase, addr);
                        break;
 
                case EEPROM_ANALOGINPUT:
-                       addi_eeprom_read_ai_info(dev, iobase, type, addr);
+                       addi_eeprom_read_ai_info(dev, iobase, addr);
                        break;
 
                case EEPROM_ANALOGOUTPUT:
-                       addi_eeprom_read_ao_info(dev, iobase, type, addr);
+                       addi_eeprom_read_ao_info(dev, iobase, addr);
                        break;
 
                case EEPROM_TIMER:
                case EEPROM_WATCHDOG:
                case EEPROM_TIMER_WATCHDOG_COUNTER:
-                       addi_eeprom_read_timer_info(dev, iobase, type, addr);
+                       addi_eeprom_read_timer_info(dev, iobase, addr);
                        break;
                }
        }