Commit 80e3e241 authored by Daeseok Youn's avatar Daeseok Youn Committed by Greg Kroah-Hartman

staging: dgnc: fix CamelCase in dgnc_driver.c

fix checkpatch.pl warning about CamelCase.
Signed-off-by: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 87787e5e
...@@ -48,7 +48,7 @@ static void dgnc_do_remap(struct dgnc_board *brd); ...@@ -48,7 +48,7 @@ static void dgnc_do_remap(struct dgnc_board *brd);
/* /*
* File operations permitted on Control/Management major. * File operations permitted on Control/Management major.
*/ */
static const struct file_operations dgnc_BoardFops = { static const struct file_operations dgnc_board_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.unlocked_ioctl = dgnc_mgmt_ioctl, .unlocked_ioctl = dgnc_mgmt_ioctl,
.open = dgnc_mgmt_open, .open = dgnc_mgmt_open,
...@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = { ...@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
/* /*
* Globals * Globals
*/ */
uint dgnc_NumBoards; uint dgnc_num_boards;
struct dgnc_board *dgnc_Board[MAXBOARDS]; struct dgnc_board *dgnc_board[MAXBOARDS];
DEFINE_SPINLOCK(dgnc_global_lock); DEFINE_SPINLOCK(dgnc_global_lock);
DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
uint dgnc_Major; uint dgnc_major;
int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ int dgnc_poll_tick = 20; /* Poll interval - 20 ms */
/* /*
...@@ -92,7 +92,7 @@ struct board_id { ...@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express; unsigned int is_pci_express;
}; };
static struct board_id dgnc_Ids[] = { static struct board_id dgnc_ids[] = {
{ PCI_DEVICE_CLASSIC_4_PCI_NAME, 4, 0 }, { PCI_DEVICE_CLASSIC_4_PCI_NAME, 4, 0 },
{ PCI_DEVICE_CLASSIC_4_422_PCI_NAME, 4, 0 }, { PCI_DEVICE_CLASSIC_4_422_PCI_NAME, 4, 0 },
{ PCI_DEVICE_CLASSIC_8_PCI_NAME, 8, 0 }, { PCI_DEVICE_CLASSIC_8_PCI_NAME, 8, 0 },
...@@ -140,14 +140,14 @@ static void cleanup(bool sysfiles) ...@@ -140,14 +140,14 @@ static void cleanup(bool sysfiles)
if (sysfiles) if (sysfiles)
dgnc_remove_driver_sysfiles(&dgnc_driver); dgnc_remove_driver_sysfiles(&dgnc_driver);
device_destroy(dgnc_class, MKDEV(dgnc_Major, 0)); device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class); class_destroy(dgnc_class);
unregister_chrdev(dgnc_Major, "dgnc"); unregister_chrdev(dgnc_major, "dgnc");
for (i = 0; i < dgnc_NumBoards; ++i) { for (i = 0; i < dgnc_num_boards; ++i) {
dgnc_remove_ports_sysfiles(dgnc_Board[i]); dgnc_remove_ports_sysfiles(dgnc_board[i]);
dgnc_tty_uninit(dgnc_Board[i]); dgnc_tty_uninit(dgnc_board[i]);
dgnc_cleanup_board(dgnc_Board[i]); dgnc_cleanup_board(dgnc_board[i]);
} }
dgnc_tty_post_uninit(); dgnc_tty_post_uninit();
...@@ -217,12 +217,12 @@ static int dgnc_start(void) ...@@ -217,12 +217,12 @@ static int dgnc_start(void)
* *
* Register management/dpa devices * Register management/dpa devices
*/ */
rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); rc = register_chrdev(0, "dgnc", &dgnc_board_fops);
if (rc < 0) { if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc); pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc; return rc;
} }
dgnc_Major = rc; dgnc_major = rc;
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt"); dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) { if (IS_ERR(dgnc_class)) {
...@@ -232,7 +232,7 @@ static int dgnc_start(void) ...@@ -232,7 +232,7 @@ static int dgnc_start(void)
} }
dev = device_create(dgnc_class, NULL, dev = device_create(dgnc_class, NULL,
MKDEV(dgnc_Major, 0), MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt"); NULL, "dgnc_mgmt");
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
rc = PTR_ERR(dev); rc = PTR_ERR(dev);
...@@ -262,11 +262,11 @@ static int dgnc_start(void) ...@@ -262,11 +262,11 @@ static int dgnc_start(void)
return 0; return 0;
failed_tty: failed_tty:
device_destroy(dgnc_class, MKDEV(dgnc_Major, 0)); device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
failed_device: failed_device:
class_destroy(dgnc_class); class_destroy(dgnc_class);
failed_class: failed_class:
unregister_chrdev(dgnc_Major, "dgnc"); unregister_chrdev(dgnc_major, "dgnc");
return rc; return rc;
} }
...@@ -283,7 +283,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -283,7 +283,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = dgnc_found_board(pdev, ent->driver_data); rc = dgnc_found_board(pdev, ent->driver_data);
if (rc == 0) if (rc == 0)
dgnc_NumBoards++; dgnc_num_boards++;
return rc; return rc;
} }
...@@ -346,7 +346,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd) ...@@ -346,7 +346,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
} }
} }
dgnc_Board[brd->boardnum] = NULL; dgnc_board[brd->boardnum] = NULL;
kfree(brd); kfree(brd);
} }
...@@ -365,8 +365,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -365,8 +365,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
unsigned long flags; unsigned long flags;
/* get the board structure and prep it */ /* get the board structure and prep it */
dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL); dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
brd = dgnc_Board[dgnc_NumBoards]; brd = dgnc_board[dgnc_num_boards];
if (!brd) if (!brd)
return -ENOMEM; return -ENOMEM;
...@@ -382,15 +382,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -382,15 +382,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
/* store the info for the board we've found */ /* store the info for the board we've found */
brd->magic = DGNC_BOARD_MAGIC; brd->magic = DGNC_BOARD_MAGIC;
brd->boardnum = dgnc_NumBoards; brd->boardnum = dgnc_num_boards;
brd->vendor = dgnc_pci_tbl[id].vendor; brd->vendor = dgnc_pci_tbl[id].vendor;
brd->device = dgnc_pci_tbl[id].device; brd->device = dgnc_pci_tbl[id].device;
brd->pdev = pdev; brd->pdev = pdev;
brd->pci_bus = pdev->bus->number; brd->pci_bus = pdev->bus->number;
brd->pci_slot = PCI_SLOT(pdev->devfn); brd->pci_slot = PCI_SLOT(pdev->devfn);
brd->name = dgnc_Ids[id].name; brd->name = dgnc_ids[id].name;
brd->maxports = dgnc_Ids[id].maxports; brd->maxports = dgnc_ids[id].maxports;
if (dgnc_Ids[i].is_pci_express) if (dgnc_ids[i].is_pci_express)
brd->bd_flags |= BD_IS_PCI_EXPRESS; brd->bd_flags |= BD_IS_PCI_EXPRESS;
brd->dpastatus = BD_NOFEP; brd->dpastatus = BD_NOFEP;
init_waitqueue_head(&brd->state_wait); init_waitqueue_head(&brd->state_wait);
...@@ -642,8 +642,8 @@ static void dgnc_poll_handler(ulong dummy) ...@@ -642,8 +642,8 @@ static void dgnc_poll_handler(ulong dummy)
unsigned long new_time; unsigned long new_time;
/* Go thru each board, kicking off a tasklet for each if needed */ /* Go thru each board, kicking off a tasklet for each if needed */
for (i = 0; i < dgnc_NumBoards; i++) { for (i = 0; i < dgnc_num_boards; i++) {
brd = dgnc_Board[i]; brd = dgnc_board[i];
spin_lock_irqsave(&brd->bd_lock, flags); spin_lock_irqsave(&brd->bd_lock, flags);
......
...@@ -399,12 +399,12 @@ struct channel_t { ...@@ -399,12 +399,12 @@ struct channel_t {
/* /*
* Our Global Variables. * Our Global Variables.
*/ */
extern uint dgnc_Major; /* Our driver/mgmt major */ extern uint dgnc_major; /* Our driver/mgmt major */
extern int dgnc_poll_tick; /* Poll interval - 20 ms */ extern int dgnc_poll_tick; /* Poll interval - 20 ms */
extern spinlock_t dgnc_global_lock; /* Driver global spinlock */ extern spinlock_t dgnc_global_lock; /* Driver global spinlock */
extern spinlock_t dgnc_poll_lock; /* Poll scheduling lock */ extern spinlock_t dgnc_poll_lock; /* Poll scheduling lock */
extern uint dgnc_NumBoards; /* Total number of boards */ extern uint dgnc_num_boards; /* Total number of boards */
extern struct dgnc_board *dgnc_Board[MAXBOARDS]; /* Array of board extern struct dgnc_board *dgnc_board[MAXBOARDS]; /* Array of board
* structs * structs
*/ */
......
...@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
spin_lock_irqsave(&dgnc_global_lock, flags); spin_lock_irqsave(&dgnc_global_lock, flags);
memset(&ddi, 0, sizeof(ddi)); memset(&ddi, 0, sizeof(ddi));
ddi.dinfo_nboards = dgnc_NumBoards; ddi.dinfo_nboards = dgnc_num_boards;
sprintf(ddi.dinfo_version, "%s", DG_PART); sprintf(ddi.dinfo_version, "%s", DG_PART);
spin_unlock_irqrestore(&dgnc_global_lock, flags); spin_unlock_irqrestore(&dgnc_global_lock, flags);
...@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (copy_from_user(&brd, uarg, sizeof(int))) if (copy_from_user(&brd, uarg, sizeof(int)))
return -EFAULT; return -EFAULT;
if (brd < 0 || brd >= dgnc_NumBoards) if (brd < 0 || brd >= dgnc_num_boards)
return -ENODEV; return -ENODEV;
memset(&di, 0, sizeof(di)); memset(&di, 0, sizeof(di));
di.info_bdnum = brd; di.info_bdnum = brd;
spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags); spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
di.info_bdtype = dgnc_Board[brd]->dpatype; di.info_bdtype = dgnc_board[brd]->dpatype;
di.info_bdstate = dgnc_Board[brd]->dpastatus; di.info_bdstate = dgnc_board[brd]->dpastatus;
di.info_ioport = 0; di.info_ioport = 0;
di.info_physaddr = (ulong)dgnc_Board[brd]->membase; di.info_physaddr = (ulong)dgnc_board[brd]->membase;
di.info_physsize = (ulong)dgnc_Board[brd]->membase di.info_physsize = (ulong)dgnc_board[brd]->membase
- dgnc_Board[brd]->membase_end; - dgnc_board[brd]->membase_end;
if (dgnc_Board[brd]->state != BOARD_FAILED) if (dgnc_board[brd]->state != BOARD_FAILED)
di.info_nports = dgnc_Board[brd]->nasync; di.info_nports = dgnc_board[brd]->nasync;
else else
di.info_nports = 0; di.info_nports = 0;
spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags); spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
if (copy_to_user(uarg, &di, sizeof(di))) if (copy_to_user(uarg, &di, sizeof(di)))
return -EFAULT; return -EFAULT;
...@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
channel = ni.channel; channel = ni.channel;
/* Verify boundaries on board */ /* Verify boundaries on board */
if (board >= dgnc_NumBoards) if (board >= dgnc_num_boards)
return -ENODEV; return -ENODEV;
/* Verify boundaries on channel */ /* Verify boundaries on channel */
if (channel >= dgnc_Board[board]->nasync) if (channel >= dgnc_board[board]->nasync)
return -ENODEV; return -ENODEV;
ch = dgnc_Board[board]->channels[channel]; ch = dgnc_board[board]->channels[channel];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return -ENODEV; return -ENODEV;
......
...@@ -33,7 +33,7 @@ static DRIVER_ATTR(version, S_IRUSR, dgnc_driver_version_show, NULL); ...@@ -33,7 +33,7 @@ static DRIVER_ATTR(version, S_IRUSR, dgnc_driver_version_show, NULL);
static ssize_t dgnc_driver_boards_show(struct device_driver *ddp, char *buf) static ssize_t dgnc_driver_boards_show(struct device_driver *ddp, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%d\n", dgnc_NumBoards); return snprintf(buf, PAGE_SIZE, "%d\n", dgnc_num_boards);
} }
static DRIVER_ATTR(boards, S_IRUSR, dgnc_driver_boards_show, NULL); static DRIVER_ATTR(boards, S_IRUSR, dgnc_driver_boards_show, NULL);
......
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