Skip to contentSkip to conversation

staging: comedi: introduce 'comedi_board' helper function

PATCH New H Hartley Sweeten 1 participant 1 message Apr 27, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: comedi: introduce 'comedi_board' helper function

This helper function is used to fetch the comedi_device board_ptr which is used during the attach to pass board specific information to the comedi drivers.

Cc Ian Abbott <[email protected]>
Cc Mori Hess <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

V2: change name

With this helper removing all the 'this_board' defines in the drivers will be easier (and cleaner).

drivers/staging/comedi/comedidev.h +5 -0
index 300fd84..02e4ae0 100644
@@ -235,6 +235,11 @@ struct comedi_device {
 	void (*close) (struct comedi_device *dev);
 };
 
+static inline const void *comedi_board(struct comedi_device *dev)
+{
+	return dev->board_ptr;
+}
+
 struct comedi_device_file_info {
 	struct comedi_device *device;
 	struct comedi_subdevice *read_subdevice;