[PATCH 04/13] staging: comedi: adv_pci1724: get rid of board_id

Ian Abbott abbotti at mev.co.uk
Tue Feb 19 13:09:11 UTC 2013


A 4-bit board ID value set by DIP switches is reported during device
attachment, but is otherwise unused by the driver, so don't bother
storing it in comedi device private storage.

Signed-off-by: Ian Abbott <abbotti at mev.co.uk>
Cc: Frank Mori Hess <fmh6jj at gmail.com>
---
 drivers/staging/comedi/drivers/adv_pci1724.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c
index b89637f..c89367d 100644
--- a/drivers/staging/comedi/drivers/adv_pci1724.c
+++ b/drivers/staging/comedi/drivers/adv_pci1724.c
@@ -138,7 +138,6 @@ MODULE_DEVICE_TABLE(pci, adv_pci1724_pci_table);
 
 /* this structure is for data unique to this hardware driver. */
 struct adv_pci1724_private {
-	unsigned board_id; /* 4 bit number settable via dip switches on board */
 	int ao_value[NUM_AO_CHANNELS];
 	int offset_value[NUM_AO_CHANNELS];
 	int gain_value[NUM_AO_CHANNELS];
@@ -267,6 +266,7 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev,
 	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	int i;
 	int retval;
+	unsigned int board_id;
 
 	dev->private = kzalloc(sizeof(struct adv_pci1724_private), GFP_KERNEL);
 	if (!dev->private)
@@ -286,14 +286,14 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev,
 		return retval;
 
 	dev->iobase = pci_resource_start(pcidev, 2);
-	priv(dev)->board_id = inl(dev->iobase + BOARD_ID_REG) & BOARD_ID_MASK;
+	board_id = inl(dev->iobase + BOARD_ID_REG) & BOARD_ID_MASK;
 
 	retval = setup_subdevices(dev);
 	if (retval < 0)
 		return retval;
 
 	dev_info(dev->class_dev, "%s (pci %s) attached, board id: %u\n",
-		 dev->board_name, pci_name(pcidev), priv(dev)->board_id);
+		 dev->board_name, pci_name(pcidev), board_id);
 	return 0;
 }
 
-- 
1.8.1.2




More information about the devel mailing list