From 21a0888f05ecba74d162ce5d1d1c445101ce3b05 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 6 Jun 2012 15:17:02 +0100 Subject: [PATCH] --- yaml --- r: 317255 b: refs/heads/master c: 4e2f002f7a9b316640eb06ef6df767f017e3e7b1 h: refs/heads/master i: 317253: 99347d95ef9a1464a9c3ed4f56cc598bf2252169 317251: e7b7e5eb86bcb0284298523b1733ad7c4aa627d4 317247: fb5d0a51e23a45226a9a42b80e262861ed3e0e5a v: v3 --- [refs] | 2 +- trunk/drivers/staging/comedi/drivers.c | 28 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b9a2e140d38a..e433bc4a1e0d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4bfa9b2ee16e73087435ac64a35f32140a385438 +refs/heads/master: 4e2f002f7a9b316640eb06ef6df767f017e3e7b1 diff --git a/trunk/drivers/staging/comedi/drivers.c b/trunk/drivers/staging/comedi/drivers.c index 9d2b206251ac..49e53eaa8e41 100644 --- a/trunk/drivers/staging/comedi/drivers.c +++ b/trunk/drivers/staging/comedi/drivers.c @@ -300,8 +300,32 @@ static int postconfig(struct comedi_device *dev) return 0; } -/* generic recognize function for drivers - * that register their supported board names */ +/* + * Generic recognize function for drivers that register their supported + * board names. + * + * 'driv->board_name' points to a 'const char *' member within the + * zeroth element of an array of some private board information + * structure, say 'struct foo_board' containing a member 'const char + * *board_name' that is initialized to point to a board name string that + * is one of the candidates matched against this function's 'name' + * parameter. + * + * 'driv->offset' is the size of the private board information + * structure, say 'sizeof(struct foo_board)', and 'driv->num_names' is + * the length of the array of private board information structures. + * + * If one of the board names in the array of private board information + * structures matches the name supplied to this function, the function + * returns a pointer to the pointer to the board name, otherwise it + * returns NULL. The return value ends up in the 'board_ptr' member of + * a 'struct comedi_device' that the low-level comedi driver's + * 'attach()' hook can convert to a point to a particular element of its + * array of private board information structures by subtracting the + * offset of the member that points to the board name. (No subtraction + * is required if the board name pointer is the first member of the + * private board information structure, which is generally the case.) + */ static void *comedi_recognize(struct comedi_driver *driv, const char *name) { char **name_ptr = (char **)driv->board_name;