Commit 7fc465b1 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: auto-config drivers do not need to set hw_dev

The comedi core now sets the 'hw_dev' pointer in the function
comedi_auto_config_helper() before calling the auto attach
function in the driver.

Remove the now unnecessary call to comedi_set_hw_dev() in the
drivers that use the auto-config attach mechanism.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c34fa261
...@@ -227,8 +227,6 @@ static int pci_8255_attach_pci(struct comedi_device *dev, ...@@ -227,8 +227,6 @@ static int pci_8255_attach_pci(struct comedi_device *dev,
int ret; int ret;
int i; int i;
comedi_set_hw_dev(dev, &pcidev->dev);
board = pci_8255_find_boardinfo(dev, pcidev); board = pci_8255_find_boardinfo(dev, pcidev);
if (!board) if (!board)
return -ENODEV; return -ENODEV;
......
...@@ -183,8 +183,6 @@ static int pci6208_attach_pci(struct comedi_device *dev, ...@@ -183,8 +183,6 @@ static int pci6208_attach_pci(struct comedi_device *dev,
unsigned int val; unsigned int val;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
boardinfo = pci6208_find_boardinfo(dev, pcidev); boardinfo = pci6208_find_boardinfo(dev, pcidev);
if (!boardinfo) if (!boardinfo)
return -ENODEV; return -ENODEV;
......
...@@ -177,8 +177,6 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, ...@@ -177,8 +177,6 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev,
int nchan; int nchan;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
board = adl_pci7x3x_find_boardinfo(dev, pcidev); board = adl_pci7x3x_find_boardinfo(dev, pcidev);
if (!board) if (!board)
return -ENODEV; return -ENODEV;
......
...@@ -218,8 +218,6 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev, ...@@ -218,8 +218,6 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
ret = comedi_pci_enable(pcidev, dev->board_name); ret = comedi_pci_enable(pcidev, dev->board_name);
......
...@@ -886,7 +886,6 @@ static int pci9111_attach_pci(struct comedi_device *dev, ...@@ -886,7 +886,6 @@ static int pci9111_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL); dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL);
......
...@@ -1265,8 +1265,6 @@ static int pci1710_attach_pci(struct comedi_device *dev, ...@@ -1265,8 +1265,6 @@ static int pci1710_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret, subdev, n_subdevices; int ret, subdev, n_subdevices;
comedi_set_hw_dev(dev, &pcidev->dev);
this_board = pci1710_find_boardinfo(dev, pcidev); this_board = pci1710_find_boardinfo(dev, pcidev);
if (!this_board) if (!this_board)
return -ENODEV; return -ENODEV;
......
...@@ -241,7 +241,6 @@ static int pci1723_attach_pci(struct comedi_device *dev, ...@@ -241,7 +241,6 @@ static int pci1723_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
...@@ -1100,8 +1100,6 @@ static int pci_dio_attach_pci(struct comedi_device *dev, ...@@ -1100,8 +1100,6 @@ static int pci_dio_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret, subdev, i, j; int ret, subdev, i, j;
comedi_set_hw_dev(dev, &pcidev->dev);
this_board = pci_dio_find_boardinfo(dev, pcidev); this_board = pci_dio_find_boardinfo(dev, pcidev);
if (!this_board) if (!this_board)
return -ENODEV; return -ENODEV;
......
...@@ -1478,8 +1478,6 @@ static int cb_pcidas_attach_pci(struct comedi_device *dev, ...@@ -1478,8 +1478,6 @@ static int cb_pcidas_attach_pci(struct comedi_device *dev,
int i; int i;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
thisboard = cb_pcidas_find_boardinfo(dev, pcidev); thisboard = cb_pcidas_find_boardinfo(dev, pcidev);
if (!thisboard) if (!thisboard)
return -ENODEV; return -ENODEV;
......
...@@ -656,8 +656,6 @@ static int cb_pcidda_attach_pci(struct comedi_device *dev, ...@@ -656,8 +656,6 @@ static int cb_pcidda_attach_pci(struct comedi_device *dev,
int index; int index;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
thisboard = cb_pcidda_find_boardinfo(dev, pcidev); thisboard = cb_pcidda_find_boardinfo(dev, pcidev);
if (!pcidev) if (!pcidev)
return -ENODEV; return -ENODEV;
......
...@@ -215,8 +215,6 @@ static int cb_pcimdas_attach_pci(struct comedi_device *dev, ...@@ -215,8 +215,6 @@ static int cb_pcimdas_attach_pci(struct comedi_device *dev,
unsigned long iobase_8255; unsigned long iobase_8255;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
...@@ -159,7 +159,6 @@ static int cb_pcimdda_attach_pci(struct comedi_device *dev, ...@@ -159,7 +159,6 @@ static int cb_pcimdda_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
...@@ -74,8 +74,6 @@ static int contec_attach_pci(struct comedi_device *dev, ...@@ -74,8 +74,6 @@ static int contec_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
ret = comedi_pci_enable(pcidev, dev->board_name); ret = comedi_pci_enable(pcidev, dev->board_name);
......
...@@ -698,8 +698,6 @@ static int daqboard2000_attach_pci(struct comedi_device *dev, ...@@ -698,8 +698,6 @@ static int daqboard2000_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int result; int result;
comedi_set_hw_dev(dev, &pcidev->dev);
board = daqboard2000_find_boardinfo(dev, pcidev); board = daqboard2000_find_boardinfo(dev, pcidev);
if (!board) if (!board)
return -ENODEV; return -ENODEV;
......
...@@ -795,7 +795,7 @@ das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev) ...@@ -795,7 +795,7 @@ das08_attach_pci(struct comedi_device *dev, struct pci_dev *pdev)
dev_err(dev->class_dev, "BUG! cannot determine board type!\n"); dev_err(dev->class_dev, "BUG! cannot determine board type!\n");
return -EINVAL; return -EINVAL;
} }
comedi_set_hw_dev(dev, &pdev->dev);
/* enable PCI device and reserve I/O spaces */ /* enable PCI device and reserve I/O spaces */
if (comedi_pci_enable(pdev, dev->driver->driver_name)) { if (comedi_pci_enable(pdev, dev->driver->driver_name)) {
dev_err(dev->class_dev, dev_err(dev->class_dev,
......
...@@ -186,8 +186,6 @@ static int dyna_pci10xx_attach_pci(struct comedi_device *dev, ...@@ -186,8 +186,6 @@ static int dyna_pci10xx_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
...@@ -502,7 +502,6 @@ static int icp_multi_attach_pci(struct comedi_device *dev, ...@@ -502,7 +502,6 @@ static int icp_multi_attach_pci(struct comedi_device *dev,
resource_size_t iobase; resource_size_t iobase;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
...@@ -94,8 +94,6 @@ static int cnt_attach_pci(struct comedi_device *dev, ...@@ -94,8 +94,6 @@ static int cnt_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
ret = comedi_pci_enable(pcidev, dev->board_name); ret = comedi_pci_enable(pcidev, dev->board_name);
......
...@@ -1578,8 +1578,6 @@ static int me4000_attach_pci(struct comedi_device *dev, ...@@ -1578,8 +1578,6 @@ static int me4000_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int result; int result;
comedi_set_hw_dev(dev, &pcidev->dev);
thisboard = me4000_find_boardinfo(dev, pcidev); thisboard = me4000_find_boardinfo(dev, pcidev);
if (!thisboard) if (!thisboard)
return -ENODEV; return -ENODEV;
......
...@@ -648,8 +648,6 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -648,8 +648,6 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
resource_size_t regbase_tmp; resource_size_t regbase_tmp;
int result, error; int result, error;
comedi_set_hw_dev(dev, &pcidev->dev);
board = me_find_boardinfo(dev, pcidev); board = me_find_boardinfo(dev, pcidev);
if (!board) if (!board)
return -ENODEV; return -ENODEV;
......
...@@ -1083,7 +1083,7 @@ static int __devinit ni_660x_attach_pci(struct comedi_device *dev, ...@@ -1083,7 +1083,7 @@ static int __devinit ni_660x_attach_pci(struct comedi_device *dev,
dev_warn(dev->class_dev, "error setting up mite\n"); dev_warn(dev->class_dev, "error setting up mite\n");
return ret; return ret;
} }
comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev);
ret = ni_660x_alloc_mite_rings(dev); ret = ni_660x_alloc_mite_rings(dev);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -1147,7 +1147,7 @@ static int __devinit nidio_attach_pci(struct comedi_device *dev, ...@@ -1147,7 +1147,7 @@ static int __devinit nidio_attach_pci(struct comedi_device *dev,
dev_warn(dev->class_dev, "error setting up mite\n"); dev_warn(dev->class_dev, "error setting up mite\n");
return ret; return ret;
} }
comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev);
devpriv->di_mite_ring = mite_alloc_ring(devpriv->mite); devpriv->di_mite_ring = mite_alloc_ring(devpriv->mite);
if (devpriv->di_mite_ring == NULL) if (devpriv->di_mite_ring == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -1661,7 +1661,7 @@ static int __devinit pcimio_attach_pci(struct comedi_device *dev, ...@@ -1661,7 +1661,7 @@ static int __devinit pcimio_attach_pci(struct comedi_device *dev,
pr_warn("error setting up mite\n"); pr_warn("error setting up mite\n");
return ret; return ret;
} }
comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev);
devpriv->ai_mite_ring = mite_alloc_ring(devpriv->mite); devpriv->ai_mite_ring = mite_alloc_ring(devpriv->mite);
if (devpriv->ai_mite_ring == NULL) if (devpriv->ai_mite_ring == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -2697,7 +2697,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -2697,7 +2697,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
comedi_set_hw_dev(dev, &pcidev->dev);
dev->board_name = dev->driver->driver_name; dev->board_name = dev->driver->driver_name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment