aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-11-19 13:04:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 16:52:24 -0500
commitff534766e4b9e25e6e4a1f133946dfa8cfe6a747 (patch)
tree613a21f4f1e62088c07f580e13d9255c088bc670
parent4e85a13b4ea73aa3bb9f735d77a949393cbbad2b (diff)
Staging: comedi: remove typedefs from comedi_bond.c
This fixes the remaining checkpatch.pl issues found in the comedi_bond.c file. Cc: Calin A. Culianu <calin@ajvar.org> Cc: David Schleef <ds@schleef.org> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/comedi/drivers/comedi_bond.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
index fc803370a040..4ded9b15c760 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -129,9 +129,8 @@ MODULE_DESCRIPTION(MODULE_NAME "A driver for COMEDI to bond multiple COMEDI "
129struct BondingBoard { 129struct BondingBoard {
130 const char *name; 130 const char *name;
131}; 131};
132typedef struct BondingBoard BondingBoard;
133 132
134static const BondingBoard bondingBoards[] = { 133static const struct BondingBoard bondingBoards[] = {
135 { 134 {
136 .name = MODULE_NAME, 135 .name = MODULE_NAME,
137 }, 136 },
@@ -140,7 +139,7 @@ static const BondingBoard bondingBoards[] = {
140/* 139/*
141 * Useful for shorthand access to the particular board structure 140 * Useful for shorthand access to the particular board structure
142 */ 141 */
143#define thisboard ((const BondingBoard *)dev->board_ptr) 142#define thisboard ((const struct BondingBoard *)dev->board_ptr)
144 143
145struct BondedDevice { 144struct BondedDevice {
146 comedi_t *dev; 145 comedi_t *dev;
@@ -152,7 +151,6 @@ struct BondedDevice {
152 channel-id's of chanid 0 on this 151 channel-id's of chanid 0 on this
153 subdevice. */ 152 subdevice. */
154}; 153};
155typedef struct BondedDevice BondedDevice;
156 154
157/* this structure is for data unique to this hardware driver. If 155/* this structure is for data unique to this hardware driver. If
158 several hardware drivers keep similar information in this structure, 156 several hardware drivers keep similar information in this structure,
@@ -165,13 +163,12 @@ struct Private {
165 struct BondedDevice *chanIdDevMap[MAX_CHANS]; 163 struct BondedDevice *chanIdDevMap[MAX_CHANS];
166 unsigned nchans; 164 unsigned nchans;
167}; 165};
168typedef struct Private Private;
169 166
170/* 167/*
171 * most drivers define the following macro to make it easy to 168 * most drivers define the following macro to make it easy to
172 * access the private structure. 169 * access the private structure.
173 */ 170 */
174#define devpriv ((Private *)dev->private) 171#define devpriv ((struct Private *)dev->private)
175 172
176/* 173/*
177 * The comedi_driver structure tells the Comedi core module 174 * The comedi_driver structure tells the Comedi core module
@@ -212,8 +209,8 @@ static comedi_driver driver_bonding = {
212 * devices are such boards. 209 * devices are such boards.
213 */ 210 */
214 .board_name = &bondingBoards[0].name, 211 .board_name = &bondingBoards[0].name,
215 .offset = sizeof(BondingBoard), 212 .offset = sizeof(struct BondingBoard),
216 .num_names = sizeof(bondingBoards) / sizeof(BondingBoard), 213 .num_names = sizeof(bondingBoards) / sizeof(struct BondingBoard),
217}; 214};
218 215
219static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s, 216static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
@@ -237,7 +234,7 @@ static int bonding_attach(comedi_device *dev, comedi_devconfig *it)
237 * Allocate the private structure area. alloc_private() is a 234 * Allocate the private structure area. alloc_private() is a
238 * convenient macro defined in comedidev.h. 235 * convenient macro defined in comedidev.h.
239 */ 236 */
240 if (alloc_private(dev, sizeof(Private)) < 0) 237 if (alloc_private(dev, sizeof(struct Private)) < 0)
241 return -ENOMEM; 238 return -ENOMEM;
242 239
243 /* 240 /*
@@ -310,7 +307,7 @@ static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
310 /* The insn data is a mask in data[0] and the new data 307 /* The insn data is a mask in data[0] and the new data
311 * in data[1], each channel cooresponding to a bit. */ 308 * in data[1], each channel cooresponding to a bit. */
312 for (i = 0; num_done < nchans && i < devpriv->ndevs; ++i) { 309 for (i = 0; num_done < nchans && i < devpriv->ndevs; ++i) {
313 BondedDevice *bdev = devpriv->devs[i]; 310 struct BondedDevice *bdev = devpriv->devs[i];
314 /* Grab the channel mask and data of only the bits corresponding 311 /* Grab the channel mask and data of only the bits corresponding
315 to this subdevice.. need to shift them to zero position of 312 to this subdevice.. need to shift them to zero position of
316 course. */ 313 course. */
@@ -348,7 +345,7 @@ static int bonding_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
348{ 345{
349 int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits; 346 int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits;
350 unsigned int io; 347 unsigned int io;
351 BondedDevice *bdev; 348 struct BondedDevice *bdev;
352 349
353 if (chan < 0 || chan >= devpriv->nchans) 350 if (chan < 0 || chan >= devpriv->nchans)
354 return -EINVAL; 351 return -EINVAL;
@@ -411,7 +408,7 @@ static int doDevConfig(comedi_device *dev, comedi_devconfig *it)
411 int minor = it->options[i]; 408 int minor = it->options[i];
412 comedi_t *d; 409 comedi_t *d;
413 int sdev = -1, nchans, tmp; 410 int sdev = -1, nchans, tmp;
414 BondedDevice *bdev = 0; 411 struct BondedDevice *bdev = 0;
415 412
416 if (minor < 0 || minor > COMEDI_NUM_BOARD_MINORS) { 413 if (minor < 0 || minor > COMEDI_NUM_BOARD_MINORS) {
417 ERROR("Minor %d is invalid!\n", minor); 414 ERROR("Minor %d is invalid!\n", minor);
@@ -506,7 +503,9 @@ static void doDevUnconfig(comedi_device *dev)
506 503
507 if (devpriv) { 504 if (devpriv) {
508 while (devpriv->ndevs-- && devpriv->devs) { 505 while (devpriv->ndevs-- && devpriv->devs) {
509 BondedDevice *bdev = devpriv->devs[devpriv->ndevs]; 506 struct BondedDevice *bdev;
507
508 bdev = devpriv->devs[devpriv->ndevs];
510 if (!bdev) 509 if (!bdev)
511 continue; 510 continue;
512 if (!(devs_closed & (0x1 << bdev->minor))) { 511 if (!(devs_closed & (0x1 << bdev->minor))) {