staging: comedi: auto-config drivers do not need to set hw_dev
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 23 Oct 2012 20:43:11 +0000 (13:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 03:28:19 +0000 (20:28 -0700)
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 <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 files changed:
drivers/staging/comedi/drivers/8255_pci.c
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci7x3x.c
drivers/staging/comedi/drivers/adl_pci8164.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidda.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/contec_pci_dio.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08.c
drivers/staging/comedi/drivers/dyna_pci10xx.c
drivers/staging/comedi/drivers/icp_multi.c
drivers/staging/comedi/drivers/ke_counter.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_pcimio.c
drivers/staging/comedi/drivers/s626.c

index 6a4f2a1ea6629030f1c38da19644ca4f556f30c9..6191a82f89a5525464a74a0832973233349701d1 100644 (file)
@@ -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;
index 343422abcd31d4b22f345e40181d711a32932013..350e87dd04d9ee2228a88400c479f9272fd2af32 100644 (file)
@@ -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;
index 599714e978b581d184f26c40a7a5f3d6f3c6b668..8eee2fa0bf00bea1e68a20b7d05647a72766d097 100644 (file)
@@ -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;
index 5a6d6d2e21b87efd816a798a064d09e1a8344a04..9999f938745eebc99a994560326af70661b8cb2c 100644 (file)
@@ -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);
index aa55443742cac871ece1f720d7ca746ab686a5f5..236a88946d006d0f9b421e7abc1aa2296db97523 100644 (file)
@@ -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);
index 4161cb6be488d16b0850f9e5450552630bc9244c..6131a0a7aa964357b9aaaacab5a4953e1ea73ba9 100644 (file)
@@ -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;
index d14ddcb17520a88f9286bfae91522cb446d26fba..2eaf56dcc952e94ebebe0b1fe983545386cec35d 100644 (file)
@@ -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);
index 47a7584d291f03f64705446d1d193674835cea42..4b29f6d050507efbb7a313078a0ac1228ab9b1eb 100644 (file)
@@ -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;
index 3f4f8bef692bf81abf95102a598f3a525373706e..0e4d189d1951a850973f5d2dfa31c91904be015d 100644 (file)
@@ -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;
index 07a8969c8919790505ef264502763e94cb9491c1..798374fe8da994472169b9a76f009be565205243 100644 (file)
@@ -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;
index 9df9a02553c0fb74d296c0fb4bb6759e8542b0f9..138cfb15814c8de8c9d31fb8edcc1cb92c2daef2 100644 (file)
@@ -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);
index 651cf18cd606c21d923acc9667ce310014d566a3..9c01500492420de3954e6e718002babe514b789e 100644 (file)
@@ -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);
index 178a6a4bb7d58203dc197d070078c2b1c480ec9b..70a9243cf33c1c51dd3dae5f06312546ed8bd596 100644 (file)
@@ -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);
index 513056d232f492b176e9c442062eccc38b31df4a..87b9cd572f800d714813aad4ad652ed543168a7d 100644 (file)
@@ -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;
index 4fa8f0baa4ac9f68a0813aa4ec287f2373118e16..fe5cf77a6aac1c947d7d52d6f34c9f2fce06c404 100644 (file)
@@ -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,
index 98e2ffb1992951293b60e62428b536370193ca04..c345660d781aacf9b0bdaf490a2cdd59f15d7b36 100644 (file)
@@ -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);
index 8a3f63484371b4be417ded8dd6461f961b1c250e..51af903773e296978c0966b810121e5a9ace2a11 100644 (file)
@@ -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);
index 8e37cff1bd8edb52d828fc2ccb1de7f3fe4ec816..355af553ed53f5159e20da37a1b46b5ff5be3ab9 100644 (file)
@@ -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);
index ae91837fe7eb3e718fcbf0968635fc1fecce8fb3..ba7fd9d53d1955c88062fbbf7b1e5a03854fef0d 100644 (file)
@@ -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;
index 33b13aedfc021c9b13d42b16041367e74d4ea503..271db1cb6070868f21fa43c61202ecb163a7848f 100644 (file)
@@ -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;
index 3cff208de8a31f75ed94cd03472f701daacbca83..5e1d8308faa9cf80893339f5ec0c469c4772928e 100644 (file)
@@ -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;
index fcf56cf4811b77ef2ec732b20d0020401d9e706e..0a556c7f9bc42bb8e92d080be23a4f846146976c 100644 (file)
@@ -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;
index 2e6dbeec9a9cac8ec6284b242d6785811e79813e..4adb4ba545caf439c3e41c8dfb539ba324ffa019 100644 (file)
@@ -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;
index 7c50b01f6a6fb7fbc9d4713e0f54a2119a9f8535..15755325121dbb9174200532e93151484b4fb973 100644 (file)
@@ -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);