Commit 98c83cfa authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: dt9812: rename 'comedi' variable in struct slot_dt9812

Because of the usb (*probe) and comedi (*attach) disconnect, the struct
slot_dt9812 is used to pass the device data between the usb_driver and
the comedi_driver. The variable 'comedi' in this struct is used during
the comedi (*attach) to indicate if a slot is currently being used.

For aesthetic reasons, rename the variable to 'devpriv' since that is
what is actually saved in the pointer.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 415227c1
...@@ -288,7 +288,7 @@ struct slot_dt9812 { ...@@ -288,7 +288,7 @@ struct slot_dt9812 {
struct semaphore mutex; struct semaphore mutex;
u32 serial; u32 serial;
struct usb_dt9812 *usb; struct usb_dt9812 *usb;
struct dt9812_private *comedi; struct dt9812_private *devpriv;
}; };
static struct slot_dt9812 dt9812[DT9812_NUM_SLOTS]; static struct slot_dt9812 dt9812[DT9812_NUM_SLOTS];
...@@ -863,7 +863,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -863,7 +863,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct slot_dt9812 *first = NULL; struct slot_dt9812 *first = NULL;
struct slot_dt9812 *best = NULL; struct slot_dt9812 *best = NULL;
for (i = 0; i < DT9812_NUM_SLOTS; i++) { for (i = 0; i < DT9812_NUM_SLOTS; i++) {
if (!first && !dt9812[i].comedi) { if (!first && !dt9812[i].devpriv) {
/* First free slot from comedi side */ /* First free slot from comedi side */
first = &dt9812[i]; first = &dt9812[i];
} }
...@@ -878,7 +878,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -878,7 +878,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
best = first; best = first;
if (best) { if (best) {
down(&best->mutex); down(&best->mutex);
best->comedi = devpriv; best->devpriv = devpriv;
best->serial = devpriv->serial; best->serial = devpriv->serial;
devpriv->slot = best; devpriv->slot = best;
up(&best->mutex); up(&best->mutex);
...@@ -1111,7 +1111,7 @@ static int __init usb_dt9812_init(void) ...@@ -1111,7 +1111,7 @@ static int __init usb_dt9812_init(void)
sema_init(&dt9812[i].mutex, 1); sema_init(&dt9812[i].mutex, 1);
dt9812[i].serial = 0; dt9812[i].serial = 0;
dt9812[i].usb = NULL; dt9812[i].usb = NULL;
dt9812[i].comedi = NULL; dt9812[i].devpriv = NULL;
} }
dt9812[12].serial = 0x0; dt9812[12].serial = 0x0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment