aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-07-18 22:03:59 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-19 19:51:39 -0400
commit27034e8ace5ab5289ee94fb53f9cd5aa821728dd (patch)
tree60406a75c9c5d819d3b10a475dea61082ee93e53
parent81f9334602a4bec05614cdc228ac5515f03b854e (diff)
staging: comedi: me_daq: store the pci_dev in the comedi_device
Use the hw_dev pointer in the comedi_device struct to hold the pci_dev instead of carrying it in the private data. Since the pci_dev was the only thing in the private data, remove the struct, the devpriv macro, and it's allocation. 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>
-rw-r--r--drivers/staging/comedi/drivers/me_daq.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c
index cd66af936dc5..8c6f8b93b277 100644
--- a/drivers/staging/comedi/drivers/me_daq.c
+++ b/drivers/staging/comedi/drivers/me_daq.c
@@ -233,7 +233,6 @@ static const struct me_board me_boards[] = {
233 233
234/* Private data structure */ 234/* Private data structure */
235struct me_private_data { 235struct me_private_data {
236 struct pci_dev *pci_device;
237 void __iomem *plx_regbase; /* PLX configuration base address */ 236 void __iomem *plx_regbase; /* PLX configuration base address */
238 void __iomem *me_regbase; /* Base address of the Meilhaus card */ 237 void __iomem *me_regbase; /* Base address of the Meilhaus card */
239 unsigned long plx_regbase_size; /* Size of PLX configuration space */ 238 unsigned long plx_regbase_size; /* Size of PLX configuration space */
@@ -662,7 +661,7 @@ static int me_attach(struct comedi_device *dev, struct comedi_devconfig *it)
662 pci_device = me_find_pci_dev(dev, it); 661 pci_device = me_find_pci_dev(dev, it);
663 if (!pci_device) 662 if (!pci_device)
664 return -EIO; 663 return -EIO;
665 dev_private->pci_device = pci_device; 664 comedi_set_hw_dev(dev, &pci_device->dev);
666 board = (struct me_board *)dev->board_ptr; 665 board = (struct me_board *)dev->board_ptr;
667 666
668 /* Enable PCI device and request PCI regions */ 667 /* Enable PCI device and request PCI regions */
@@ -799,6 +798,8 @@ static int me_attach(struct comedi_device *dev, struct comedi_devconfig *it)
799 798
800static void me_detach(struct comedi_device *dev) 799static void me_detach(struct comedi_device *dev)
801{ 800{
801 struct pci_dev *pcidev = comedi_to_pci_dev(dev);
802
802 if (dev_private) { 803 if (dev_private) {
803 if (dev_private->me_regbase) { 804 if (dev_private->me_regbase) {
804 me_reset(dev); 805 me_reset(dev);
@@ -806,11 +807,11 @@ static void me_detach(struct comedi_device *dev)
806 } 807 }
807 if (dev_private->plx_regbase) 808 if (dev_private->plx_regbase)
808 iounmap(dev_private->plx_regbase); 809 iounmap(dev_private->plx_regbase);
809 if (dev_private->pci_device) { 810 }
810 if (dev_private->plx_regbase_size) 811 if (pcidev) {
811 comedi_pci_disable(dev_private->pci_device); 812 if (dev_private->plx_regbase_size)
812 pci_dev_put(dev_private->pci_device); 813 comedi_pci_disable(pcidev);
813 } 814 pci_dev_put(pcidev);
814 } 815 }
815} 816}
816 817