staging: comedi: remove unnecessary dev->board_name initialization
The dev->board_name is now initialized by the comedi core before calling the(*attach) or (*auto_attach) function in a driver. As long as the driver does no additional probing, it's no longer necessary initialize the board_name. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
46c58127ad
commit
5993f3a269
51 changed files with 8 additions and 90 deletions
|
@ -354,8 +354,6 @@ static int dev_8255_attach(struct comedi_device *dev,
|
|||
unsigned long iobase;
|
||||
int i;
|
||||
|
||||
dev->board_name = "8255";
|
||||
|
||||
for (i = 0; i < COMEDI_NDEVCONFOPTS; i++) {
|
||||
iobase = it->options[i];
|
||||
if (!iobase)
|
||||
|
|
|
@ -296,8 +296,6 @@ static int apci1032_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -35,8 +35,6 @@ static int apci1710_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -287,8 +287,6 @@ static int apci2032_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_pci_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -88,8 +88,6 @@ static int apci2200_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_pci_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -339,8 +339,6 @@ static int apci3501_auto_attach(struct comedi_device *dev,
|
|||
int ao_n_chan;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -78,8 +78,6 @@ static int adl_pci8164_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_pci_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -865,8 +865,6 @@ static int pci9111_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL);
|
||||
if (!dev_private)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -217,8 +217,6 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
int unipolar, differential;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
unipolar = it->options[1];
|
||||
differential = it->options[2];
|
||||
|
|
|
@ -242,8 +242,6 @@ static int pci1723_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -358,8 +358,6 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev,
|
|||
devpriv->gain_value[i] = -1;
|
||||
}
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
retval = comedi_pci_enable(dev);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
|
|
@ -83,8 +83,6 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
|
|||
|
||||
printk(KERN_INFO "comedi%d: aio_iiro_16: ", dev->minor);
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
|
||||
if (!request_region(iobase, AIO_IIRO_16_SIZE, dev->board_name)) {
|
||||
|
|
|
@ -431,7 +431,6 @@ static int c6xdigio_attach(struct comedi_device *dev,
|
|||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "c6xdigio";
|
||||
|
||||
result = comedi_alloc_subdevices(dev, 2);
|
||||
if (result)
|
||||
|
|
|
@ -215,8 +215,6 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
|
|||
unsigned long iobase_8255;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -161,8 +161,6 @@ static int cb_pcimdda_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -266,8 +266,6 @@ static int parport_attach(struct comedi_device *dev,
|
|||
unsigned long iobase;
|
||||
struct comedi_subdevice *s;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
if (!request_region(iobase, PARPORT_SIZE, dev->board_name)) {
|
||||
dev_err(dev->class_dev, "I/O port conflict\n");
|
||||
|
|
|
@ -384,8 +384,6 @@ static int waveform_attach(struct comedi_device *dev,
|
|||
int i;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -77,8 +77,6 @@ static int contec_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_pci_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -573,8 +573,6 @@ static int das16m1_attach(struct comedi_device *dev,
|
|||
unsigned int irq;
|
||||
unsigned long iobase;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
|
|
|
@ -288,8 +288,6 @@ static int das6402_attach(struct comedi_device *dev,
|
|||
int ret;
|
||||
struct comedi_subdevice *s;
|
||||
|
||||
dev->board_name = "das6402";
|
||||
|
||||
iobase = it->options[0];
|
||||
if (iobase == 0)
|
||||
iobase = 0x300;
|
||||
|
|
|
@ -698,8 +698,6 @@ static int dmm32at_attach(struct comedi_device *dev,
|
|||
unsigned long iobase;
|
||||
unsigned int irq;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
irq = it->options[1];
|
||||
|
||||
|
|
|
@ -255,7 +255,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "dt2814";
|
||||
|
||||
outb(0, dev->iobase + DT2814_CSR);
|
||||
udelay(100);
|
||||
|
|
|
@ -171,7 +171,6 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
}
|
||||
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "dt2815";
|
||||
|
||||
ret = comedi_alloc_subdevices(dev, 1);
|
||||
if (ret)
|
||||
|
|
|
@ -135,7 +135,6 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "dt2817";
|
||||
|
||||
ret = comedi_alloc_subdevices(dev, 1);
|
||||
if (ret)
|
||||
|
|
|
@ -1012,8 +1012,6 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = "dt9812";
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -187,8 +187,6 @@ static int dyna_pci10xx_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -125,7 +125,6 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "fl512";
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
|
|
|
@ -503,8 +503,6 @@ static int icp_multi_auto_attach(struct comedi_device *dev,
|
|||
resource_size_t iobase;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -212,7 +212,6 @@ static int pci20xxx_attach(struct comedi_device *dev,
|
|||
dev->private = devpriv;
|
||||
|
||||
devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];
|
||||
dev->board_name = "pci20kc";
|
||||
|
||||
/* Check PCI-20001 C-2A Carrier Board ID */
|
||||
if ((readb(devpriv->ioaddr) & PCI20000_ID) != PCI20000_ID) {
|
||||
|
|
|
@ -700,7 +700,6 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
|
|||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
dev->board_name = "jr3_pci";
|
||||
|
||||
result = comedi_pci_enable(dev);
|
||||
if (result)
|
||||
|
|
|
@ -96,8 +96,6 @@ static int cnt_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_pci_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -296,7 +296,6 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
}
|
||||
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "mpc624";
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
|
|
|
@ -252,7 +252,6 @@ static int multiq3_attach(struct comedi_device *dev,
|
|||
dev->minor, irq);
|
||||
else
|
||||
printk(KERN_WARNING "comedi%d: no irq\n", dev->minor);
|
||||
dev->board_name = "multiq3";
|
||||
|
||||
result = comedi_alloc_subdevices(dev, 5);
|
||||
if (result)
|
||||
|
|
|
@ -202,8 +202,6 @@ static int daq700_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
link->config_flags |= CONF_AUTO_SET_IO;
|
||||
ret = comedi_pcmcia_enable(dev, NULL);
|
||||
if (ret)
|
||||
|
|
|
@ -52,8 +52,6 @@ static int dio24_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
link->config_flags |= CONF_AUTO_SET_IO;
|
||||
ret = comedi_pcmcia_enable(dev, NULL);
|
||||
if (ret)
|
||||
|
|
|
@ -54,7 +54,6 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
printk("I/O port conflict\n");
|
||||
return -EIO;
|
||||
}
|
||||
dev->board_name = "pcl725";
|
||||
dev->iobase = iobase;
|
||||
dev->irq = 0;
|
||||
|
||||
|
|
|
@ -230,8 +230,6 @@ static int pcm3724_attach(struct comedi_device *dev,
|
|||
unsigned int iorange;
|
||||
int ret, i;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
iorange = PCM3724_SIZE;
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ static int pcm3730_attach(struct comedi_device *dev,
|
|||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
dev->board_name = "pcm3730";
|
||||
dev->iobase = dev->iobase;
|
||||
dev->irq = 0;
|
||||
|
||||
|
|
|
@ -168,8 +168,6 @@ static int pcmda12_attach(struct comedi_device *dev,
|
|||
}
|
||||
dev->iobase = iobase;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -1038,8 +1038,6 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
unsigned int irq[MAX_ASICS];
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
irq[0] = it->options[1];
|
||||
|
||||
|
|
|
@ -715,8 +715,6 @@ static int daqp_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -103,8 +103,6 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
}
|
||||
dev->iobase = iobase;
|
||||
|
||||
dev->board_name = "rti802";
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -555,8 +555,6 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
int iobase;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
iobase = it->options[0];
|
||||
if (!iobase || !request_region(iobase, S526_IOSIZE, dev->board_name)) {
|
||||
comedi_error(dev, "I/O port conflict");
|
||||
|
|
|
@ -2590,8 +2590,6 @@ static int s626_auto_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -724,8 +724,6 @@ static int serial2002_attach(struct comedi_device *dev,
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
if (!devpriv)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -481,10 +481,12 @@ static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
|
||||
thisboard = comedi_board(dev);
|
||||
|
||||
/*
|
||||
* Initialize dev->board_name.
|
||||
*/
|
||||
dev->board_name = thisboard->name;
|
||||
/*
|
||||
* The dev->board_name is initialized by the comedi core before
|
||||
* calling the (*attach) function. It can be optionally set by
|
||||
* the driver if additional probing has been done.
|
||||
*/
|
||||
/* dev->board_name = thisboard->name; */
|
||||
|
||||
/* Allocate the private data */
|
||||
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
|
||||
|
|
|
@ -167,8 +167,6 @@ static int dnp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
struct comedi_subdevice *s;
|
||||
int ret;
|
||||
|
||||
dev->board_name = dev->driver->driver_name;
|
||||
|
||||
ret = comedi_alloc_subdevices(dev, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -442,7 +442,6 @@ static int unioxx5_attach(struct comedi_device *dev,
|
|||
|
||||
iobase = it->options[0];
|
||||
|
||||
dev->board_name = DRIVER_NAME;
|
||||
dev->iobase = iobase;
|
||||
iobase += UNIOXX5_SUBDEV_BASE;
|
||||
|
||||
|
|
|
@ -2207,8 +2207,6 @@ static int usbdux_attach_common(struct comedi_device *dev,
|
|||
/* pointer back to the corresponding comedi device */
|
||||
udev->comedidev = dev;
|
||||
|
||||
dev->board_name = "usbdux";
|
||||
|
||||
/* set number of subdevices */
|
||||
if (udev->high_speed) {
|
||||
/* with pwm */
|
||||
|
|
|
@ -1387,7 +1387,7 @@ static int usbduxfast_attach_common(struct comedi_device *dev,
|
|||
down(&udfs->sem);
|
||||
/* pointer back to the corresponding comedi device */
|
||||
udfs->comedidev = dev;
|
||||
dev->board_name = "usbduxfast";
|
||||
|
||||
ret = comedi_alloc_subdevices(dev, 1);
|
||||
if (ret) {
|
||||
up(&udfs->sem);
|
||||
|
|
|
@ -2205,7 +2205,7 @@ static int usbduxsigma_attach_common(struct comedi_device *dev,
|
|||
down(&uds->sem);
|
||||
/* pointer back to the corresponding comedi device */
|
||||
uds->comedidev = dev;
|
||||
dev->board_name = "usbduxsigma";
|
||||
|
||||
/* set number of subdevices */
|
||||
if (uds->high_speed)
|
||||
n_subdevs = 4; /* with pwm */
|
||||
|
|
Loading…
Add table
Reference in a new issue