[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-driver-devel
Subject:    [PATCH 09/15] staging: comedi: ni_daq_dio24: remove thisboard macro
From:       H Hartley Sweeten <hsweeten () visionengravers ! com>
Date:       2013-01-30 23:45:09
Message-ID: 201301301645.09881.hsweeten () visionengravers ! com
[Download RAW message or body]

The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable.

Replace the macro with a local variable and use the comedi_board()
helper to get the pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/ni_daq_dio24.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c \
b/drivers/staging/comedi/drivers/ni_daq_dio24.c index acfef6e..4982cc7 100644
--- a/drivers/staging/comedi/drivers/ni_daq_dio24.c
+++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c
@@ -83,11 +83,6 @@ static const struct dio24_board_struct dio24_boards[] = {
 	 },
 };
 
-/*
- * Useful for shorthand access to the particular board structure
- */
-#define thisboard ((const struct dio24_board_struct *)dev->board_ptr)
-
 struct dio24_private {
 
 	int data;		/* number of data points left to be taken */
@@ -95,6 +90,7 @@ struct dio24_private {
 
 static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
+	const struct dio24_board_struct *thisboard = comedi_board(dev);
 	struct dio24_private *devpriv;
 	struct comedi_subdevice *s;
 	unsigned long iobase = 0;
@@ -159,6 +155,7 @@ static int dio24_attach(struct comedi_device *dev, struct \
comedi_devconfig *it)  
 static void dio24_detach(struct comedi_device *dev)
 {
+	const struct dio24_board_struct *thisboard = comedi_board(dev);
 	struct comedi_subdevice *s;
 
 	if (dev->subdevices) {
-- 
1.8.1.1.293.gfe73786

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic