MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line");
MODULE_SUPPORTED_DEVICE("dgnc");
-/*
- * File operations permitted on Control/Management major.
- */
+/* File operations permitted on Control/Management major. */
+
static const struct file_operations dgnc_board_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = dgnc_mgmt_ioctl,
.release = dgnc_mgmt_close
};
-/*
- * Globals
- */
+/* Globals */
+
uint dgnc_num_boards;
struct dgnc_board *dgnc_board[MAXBOARDS];
DEFINE_SPINLOCK(dgnc_global_lock);
uint dgnc_major;
int dgnc_poll_tick = 20; /* Poll interval - 20 ms */
-/*
- * Static vars.
- */
+/* Static vars. */
+
static struct class *dgnc_class;
-/*
- * Poller stuff
- */
+/* Poller stuff */
+
static ulong dgnc_poll_time; /* Time of next poll */
static uint dgnc_poll_stop; /* Used to tell poller to stop */
static struct timer_list dgnc_poll_timer;
-/*
- * Remap PCI memory.
- */
+/* Remap PCI memory. */
+
static int dgnc_do_remap(struct dgnc_board *brd)
{
int rc = 0;
}
/*
- *
* Function:
*
* dgnc_poll_handler
* As each timer expires, it determines (a) whether the "transmit"
* waiter needs to be woken up, and (b) whether the poller needs to
* be rescheduled.
- *
*/
static void dgnc_poll_handler(ulong dummy)
spin_unlock_irqrestore(&brd->bd_lock, flags);
}
- /*
- * Schedule ourself back at the nominal wakeup interval.
- */
+ /* Schedule ourself back at the nominal wakeup interval. */
+
spin_lock_irqsave(&dgnc_poll_lock, flags);
dgnc_poll_time += dgnc_jiffies_from_ms(dgnc_poll_tick);
if (IS_ERR(brd))
return PTR_ERR(brd);
- /*
- * Do tty device initialization.
- */
+ /* Do tty device initialization. */
rc = dgnc_tty_register(brd);
if (rc < 0) {
.id_table = dgnc_pci_tbl,
};
-/*
- * Start of driver.
- */
+/* Start of driver. */
+
static int dgnc_start(void)
{
int rc = 0;
kfree(brd);
}
-/************************************************************************
- *
- * Driver load/unload functions
- *
- ************************************************************************/
+/* Driver load/unload functions */
static void cleanup(bool sysfiles)
{
{
int rc;
- /*
- * Initialize global stuff
- */
+ /* Initialize global stuff */
+
rc = dgnc_start();
if (rc < 0)
return rc;
- /*
- * Find and configure all the cards
- */
+ /* Find and configure all the cards */
+
rc = pci_register_driver(&dgnc_driver);
if (rc) {
pr_warn("WARNING: dgnc driver load failed. No Digi Neo or Classic boards found.\n");