Skip to content

Commit

Permalink
staging: comedi: adv_pci_dio: move and rename the MAX_*_SUBDEV[SG] de…
Browse files Browse the repository at this point in the history
…fines

For aesthetics, move these defines after the register defines and rename
them to have namespace associated with the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Dec 21, 2015
1 parent 2b60bbd commit a54b6e6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/staging/comedi/drivers/adv_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
#include "8255.h"
#include "comedi_8254.h"

#define MAX_DI_SUBDEVS 2 /* max number of DI subdevices per card */
#define MAX_DO_SUBDEVS 2 /* max number of DO subdevices per card */
#define MAX_DIO_SUBDEVG 2 /* max number of DIO subdevices group per
* card */

/*
* Register offset definitions
*/
Expand All @@ -61,6 +56,11 @@
/* PCI-1762 interrupt control registers */
#define PCI1762_INT_REG 0x06 /* R/W: status/control */

/* maximum number of subdevice descriptions in the boardinfo */
#define PCI_DIO_MAX_DI_SUBDEVS 2 /* 2 x 8/16/32 input channels max */
#define PCI_DIO_MAX_DO_SUBDEVS 2 /* 2 x 8/16/32 output channels max */
#define PCI_DIO_MAX_DIO_SUBDEVG 2 /* 2 x any number of 8255 devices max */

enum pci_dio_boardid {
TYPE_PCI1730,
TYPE_PCI1733,
Expand All @@ -86,9 +86,9 @@ struct diosubd_data {
struct dio_boardtype {
const char *name; /* board name */
int nsubdevs;
struct diosubd_data sdi[MAX_DI_SUBDEVS]; /* DI chans */
struct diosubd_data sdo[MAX_DO_SUBDEVS]; /* DO chans */
struct diosubd_data sdio[MAX_DIO_SUBDEVG]; /* DIO 8255 chans */
struct diosubd_data sdi[PCI_DIO_MAX_DI_SUBDEVS];
struct diosubd_data sdo[PCI_DIO_MAX_DO_SUBDEVS];
struct diosubd_data sdio[PCI_DIO_MAX_DIO_SUBDEVG];
unsigned long id_reg;
unsigned long timer_regbase;
unsigned int is_16bit:1;
Expand Down Expand Up @@ -385,7 +385,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
return ret;

subdev = 0;
for (i = 0; i < MAX_DI_SUBDEVS; i++) {
for (i = 0; i < PCI_DIO_MAX_DI_SUBDEVS; i++) {
d = &board->sdi[i];
if (d->chans) {
s = &dev->subdevices[subdev++];
Expand All @@ -401,7 +401,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
}
}

for (i = 0; i < MAX_DO_SUBDEVS; i++) {
for (i = 0; i < PCI_DIO_MAX_DO_SUBDEVS; i++) {
d = &board->sdo[i];
if (d->chans) {
s = &dev->subdevices[subdev++];
Expand Down Expand Up @@ -432,7 +432,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
}
}

for (i = 0; i < MAX_DIO_SUBDEVG; i++) {
for (i = 0; i < PCI_DIO_MAX_DIO_SUBDEVG; i++) {
d = &board->sdio[i];
for (j = 0; j < d->chans; j++) {
s = &dev->subdevices[subdev++];
Expand Down

0 comments on commit a54b6e6

Please sign in to comment.