lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201207111525.46227.hartleys@visionengravers.com>
Date:	Wed, 11 Jul 2012 15:25:45 -0700
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
CC:	<devel@...verdev.osuosl.org>, <abbotti@....co.uk>,
	<gregkh@...uxfoundation.org>
Subject: [PATCH 13/30] staging: comedi: cb_pcidas: use comedi_device pci_dev pointer

Use the pci_dev pointer in the comedi_device struct instead of
carrying it in the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: Ian Abbott <abbotti@....co.uk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/staging/comedi/drivers/cb_pcidas.c | 31 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 301444e..39b02e8 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -343,7 +343,6 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
 };
 
 struct cb_pcidas_private {
-	struct pci_dev *pci_dev;
 	/* base addresses */
 	unsigned long s5933_config;
 	unsigned long control_status;
@@ -1553,35 +1552,35 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 		return -ENOMEM;
 	devpriv = dev->private;
 
-	devpriv->pci_dev = cb_pcidas_find_pci_device(dev, it);
-	if (!devpriv->pci_dev)
+	dev->pcidev = cb_pcidas_find_pci_device(dev, it);
+	if (!dev->pcidev)
 		return -EIO;
 	thisboard = comedi_board(dev);
 
-	if (comedi_pci_enable(devpriv->pci_dev, dev->driver->driver_name)) {
+	if (comedi_pci_enable(dev->pcidev, dev->driver->driver_name)) {
 		dev_err(dev->class_dev,
 			"Failed to enable PCI device and request regions\n");
 		return -EIO;
 	}
 
-	devpriv->s5933_config = pci_resource_start(devpriv->pci_dev, 0);
-	devpriv->control_status = pci_resource_start(devpriv->pci_dev, 1);
-	devpriv->adc_fifo = pci_resource_start(devpriv->pci_dev, 2);
-	devpriv->pacer_counter_dio = pci_resource_start(devpriv->pci_dev, 3);
+	devpriv->s5933_config = pci_resource_start(dev->pcidev, 0);
+	devpriv->control_status = pci_resource_start(dev->pcidev, 1);
+	devpriv->adc_fifo = pci_resource_start(dev->pcidev, 2);
+	devpriv->pacer_counter_dio = pci_resource_start(dev->pcidev, 3);
 	if (thisboard->ao_nchan)
-		devpriv->ao_registers = pci_resource_start(devpriv->pci_dev, 4);
+		devpriv->ao_registers = pci_resource_start(dev->pcidev, 4);
 
 	/*  disable and clear interrupts on amcc s5933 */
 	outl(INTCSR_INBOX_INTR_STATUS,
 	     devpriv->s5933_config + AMCC_OP_REG_INTCSR);
 
-	if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt,
+	if (request_irq(dev->pcidev->irq, cb_pcidas_interrupt,
 			IRQF_SHARED, dev->driver->driver_name, dev)) {
 		dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
-			devpriv->pci_dev->irq);
+			dev->pcidev->irq);
 		return -EINVAL;
 	}
-	dev->irq = devpriv->pci_dev->irq;
+	dev->irq = dev->pcidev->irq;
 
 	dev->board_name = thisboard->name;
 
@@ -1714,10 +1713,10 @@ static void cb_pcidas_detach(struct comedi_device *dev)
 		free_irq(dev->irq, dev);
 	if (dev->subdevices)
 		subdev_8255_cleanup(dev, dev->subdevices + 2);
-	if (devpriv && devpriv->pci_dev) {
-		if (devpriv->s5933_config)
-			comedi_pci_disable(devpriv->pci_dev);
-		pci_dev_put(devpriv->pci_dev);
+	if (dev->pcidev) {
+		if (devpriv && devpriv->s5933_config)
+			comedi_pci_disable(dev->pcidev);
+		pci_dev_put(dev->pcidev);
 	}
 }
 
-- 
1.7.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ