Re: [PATCH 10/14] staging: comedi: jr3_pci: introduce boardinfo for the supported boards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2014-03-07 20:41, H Hartley Sweeten wrote:
Create an enum for the boards supported by this driver and pass that enum in
the pci_driver id_table as the driver_data.

Introduce a boardinfo struct to hold the board specific data for the boards
supported by this driver. Use the boardinfo when attaching to the driver
instead of using the pcidev->device and the switch.

Since the PCI device ids are now only used in the id_table, remove the
defines and open code the device ids.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/comedi/drivers/jr3_pci.c | 77 +++++++++++++++++++-------------
  1 file changed, 46 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index f80bfcb..904104e 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
[snip]
@@ -798,11 +813,11 @@ static int jr3_pci_pci_probe(struct pci_dev *dev,
  }

  static const struct pci_device_id jr3_pci_pci_table[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_1_CHANNEL) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_1_CHANNEL_NEW) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_2_CHANNEL) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_3_CHANNEL) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_4_CHANNEL) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, 0x1111), BOARD_JR3_1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, 0x3111), BOARD_JR3_1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, 0x3112), BOARD_JR3_2 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, 0x3113), BOARD_JR3_3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_JR3, 0x3114), BOARD_JR3_4 },

That's initializing the `class` member instead of the `driver_data` member. You can use `PCI_VDEVICE(JR3, 0x1111, BOARD_JR3_1)`, etc. to fix it.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux