From: H Hartley Sweeten Date: Tue, 23 Oct 2012 20:43:11 +0000 (-0700) Subject: staging: comedi: auto-config drivers do not need to set hw_dev X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7fc465b106b40a598d83a0c98d0e8c2a1b4653ff;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/8255_pci.c b/drivers/staging/comedi/drivers/8255_pci.c index 6a4f2a1ea66..6191a82f89a 100644 --- a/drivers/staging/comedi/drivers/8255_pci.c +++ b/drivers/staging/comedi/drivers/8255_pci.c @@ -227,8 +227,6 @@ static int pci_8255_attach_pci(struct comedi_device *dev, int ret; int i; - comedi_set_hw_dev(dev, &pcidev->dev); - board = pci_8255_find_boardinfo(dev, pcidev); if (!board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c index 343422abcd3..350e87dd04d 100644 --- a/drivers/staging/comedi/drivers/adl_pci6208.c +++ b/drivers/staging/comedi/drivers/adl_pci6208.c @@ -183,8 +183,6 @@ static int pci6208_attach_pci(struct comedi_device *dev, unsigned int val; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - boardinfo = pci6208_find_boardinfo(dev, pcidev); if (!boardinfo) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c index 599714e978b..8eee2fa0bf0 100644 --- a/drivers/staging/comedi/drivers/adl_pci7x3x.c +++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c @@ -177,8 +177,6 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, int nchan; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - board = adl_pci7x3x_find_boardinfo(dev, pcidev); if (!board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/adl_pci8164.c b/drivers/staging/comedi/drivers/adl_pci8164.c index 5a6d6d2e21b..9999f938745 100644 --- a/drivers/staging/comedi/drivers/adl_pci8164.c +++ b/drivers/staging/comedi/drivers/adl_pci8164.c @@ -218,8 +218,6 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - dev->board_name = dev->driver->driver_name; ret = comedi_pci_enable(pcidev, dev->board_name); diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index aa55443742c..236a88946d0 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -886,7 +886,6 @@ static int pci9111_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); dev->board_name = dev->driver->driver_name; dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 4161cb6be48..6131a0a7aa9 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -1265,8 +1265,6 @@ static int pci1710_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret, subdev, n_subdevices; - comedi_set_hw_dev(dev, &pcidev->dev); - this_board = pci1710_find_boardinfo(dev, pcidev); if (!this_board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/adv_pci1723.c b/drivers/staging/comedi/drivers/adv_pci1723.c index d14ddcb1752..2eaf56dcc95 100644 --- a/drivers/staging/comedi/drivers/adv_pci1723.c +++ b/drivers/staging/comedi/drivers/adv_pci1723.c @@ -241,7 +241,6 @@ static int pci1723_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c index 47a7584d291..4b29f6d0505 100644 --- a/drivers/staging/comedi/drivers/adv_pci_dio.c +++ b/drivers/staging/comedi/drivers/adv_pci_dio.c @@ -1100,8 +1100,6 @@ static int pci_dio_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret, subdev, i, j; - comedi_set_hw_dev(dev, &pcidev->dev); - this_board = pci_dio_find_boardinfo(dev, pcidev); if (!this_board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index 3f4f8bef692..0e4d189d195 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -1478,8 +1478,6 @@ static int cb_pcidas_attach_pci(struct comedi_device *dev, int i; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - thisboard = cb_pcidas_find_boardinfo(dev, pcidev); if (!thisboard) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c index 07a8969c891..798374fe8da 100644 --- a/drivers/staging/comedi/drivers/cb_pcidda.c +++ b/drivers/staging/comedi/drivers/cb_pcidda.c @@ -656,8 +656,6 @@ static int cb_pcidda_attach_pci(struct comedi_device *dev, int index; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - thisboard = cb_pcidda_find_boardinfo(dev, pcidev); if (!pcidev) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c index 9df9a02553c..138cfb15814 100644 --- a/drivers/staging/comedi/drivers/cb_pcimdas.c +++ b/drivers/staging/comedi/drivers/cb_pcimdas.c @@ -215,8 +215,6 @@ static int cb_pcimdas_attach_pci(struct comedi_device *dev, unsigned long iobase_8255; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/cb_pcimdda.c b/drivers/staging/comedi/drivers/cb_pcimdda.c index 651cf18cd60..9c015004924 100644 --- a/drivers/staging/comedi/drivers/cb_pcimdda.c +++ b/drivers/staging/comedi/drivers/cb_pcimdda.c @@ -159,7 +159,6 @@ static int cb_pcimdda_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/contec_pci_dio.c b/drivers/staging/comedi/drivers/contec_pci_dio.c index 178a6a4bb7d..70a9243cf33 100644 --- a/drivers/staging/comedi/drivers/contec_pci_dio.c +++ b/drivers/staging/comedi/drivers/contec_pci_dio.c @@ -74,8 +74,6 @@ static int contec_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - dev->board_name = dev->driver->driver_name; ret = comedi_pci_enable(pcidev, dev->board_name); diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index 513056d232f..87b9cd572f8 100644 --- a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c @@ -698,8 +698,6 @@ static int daqboard2000_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int result; - comedi_set_hw_dev(dev, &pcidev->dev); - board = daqboard2000_find_boardinfo(dev, pcidev); if (!board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index 4fa8f0baa4a..fe5cf77a6aa 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -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"); return -EINVAL; } - comedi_set_hw_dev(dev, &pdev->dev); + /* enable PCI device and reserve I/O spaces */ if (comedi_pci_enable(pdev, dev->driver->driver_name)) { dev_err(dev->class_dev, diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c index 98e2ffb1992..c345660d781 100644 --- a/drivers/staging/comedi/drivers/dyna_pci10xx.c +++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c @@ -186,8 +186,6 @@ static int dyna_pci10xx_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/icp_multi.c b/drivers/staging/comedi/drivers/icp_multi.c index 8a3f6348437..51af903773e 100644 --- a/drivers/staging/comedi/drivers/icp_multi.c +++ b/drivers/staging/comedi/drivers/icp_multi.c @@ -502,7 +502,6 @@ static int icp_multi_attach_pci(struct comedi_device *dev, resource_size_t iobase; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); diff --git a/drivers/staging/comedi/drivers/ke_counter.c b/drivers/staging/comedi/drivers/ke_counter.c index 8e37cff1bd8..355af553ed5 100644 --- a/drivers/staging/comedi/drivers/ke_counter.c +++ b/drivers/staging/comedi/drivers/ke_counter.c @@ -94,8 +94,6 @@ static int cnt_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); - dev->board_name = dev->driver->driver_name; ret = comedi_pci_enable(pcidev, dev->board_name); diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index ae91837fe7e..ba7fd9d53d1 100644 --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -1578,8 +1578,6 @@ static int me4000_attach_pci(struct comedi_device *dev, struct comedi_subdevice *s; int result; - comedi_set_hw_dev(dev, &pcidev->dev); - thisboard = me4000_find_boardinfo(dev, pcidev); if (!thisboard) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 33b13aedfc0..271db1cb607 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -648,8 +648,6 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) resource_size_t regbase_tmp; int result, error; - comedi_set_hw_dev(dev, &pcidev->dev); - board = me_find_boardinfo(dev, pcidev); if (!board) return -ENODEV; diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 3cff208de8a..5e1d8308faa 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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"); return ret; } - comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev); + ret = ni_660x_alloc_mite_rings(dev); if (ret < 0) return ret; diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index fcf56cf4811..0a556c7f9bc 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c @@ -1147,7 +1147,7 @@ static int __devinit nidio_attach_pci(struct comedi_device *dev, dev_warn(dev->class_dev, "error setting up mite\n"); return ret; } - comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev); + devpriv->di_mite_ring = mite_alloc_ring(devpriv->mite); if (devpriv->di_mite_ring == NULL) return -ENOMEM; diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 2e6dbeec9a9..4adb4ba545c 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1661,7 +1661,7 @@ static int __devinit pcimio_attach_pci(struct comedi_device *dev, pr_warn("error setting up mite\n"); return ret; } - comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev); + devpriv->ai_mite_ring = mite_alloc_ring(devpriv->mite); if (devpriv->ai_mite_ring == NULL) return -ENOMEM; diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 7c50b01f6a6..15755325121 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2697,7 +2697,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) struct comedi_subdevice *s; int ret; - comedi_set_hw_dev(dev, &pcidev->dev); dev->board_name = dev->driver->driver_name; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);