Commit 1d8c5aa3 authored by Konrad Zapalowicz's avatar Konrad Zapalowicz Committed by Greg Kroah-Hartman

staging: dgnc: Remove driver-wide state variable

This commit removes the driver's global state variable. This is ok
because the state was changed only once at the end of init phase thus
the future usage of this variable is pointless.
Signed-off-by: default avatarKonrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fd2914a
...@@ -90,7 +90,6 @@ static const struct file_operations dgnc_BoardFops = { ...@@ -90,7 +90,6 @@ static const struct file_operations dgnc_BoardFops = {
uint dgnc_NumBoards; uint dgnc_NumBoards;
struct dgnc_board *dgnc_Board[MAXBOARDS]; struct dgnc_board *dgnc_Board[MAXBOARDS];
DEFINE_SPINLOCK(dgnc_global_lock); DEFINE_SPINLOCK(dgnc_global_lock);
int dgnc_driver_state = DRIVER_INITIALIZED;
ulong dgnc_poll_counter; ulong dgnc_poll_counter;
uint dgnc_Major; uint dgnc_Major;
int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ int dgnc_poll_tick = 20; /* Poll interval - 20 ms */
...@@ -174,12 +173,6 @@ char *dgnc_state_text[] = { ...@@ -174,12 +173,6 @@ char *dgnc_state_text[] = {
"Board READY", "Board READY",
}; };
char *dgnc_driver_state_text[] = {
"Driver Initialized",
"Driver Ready."
};
/************************************************************************ /************************************************************************
* *
...@@ -331,8 +324,6 @@ static int dgnc_start(void) ...@@ -331,8 +324,6 @@ static int dgnc_start(void)
add_timer(&dgnc_poll_timer); add_timer(&dgnc_poll_timer);
dgnc_driver_state = DRIVER_READY;
return rc; return rc;
} }
...@@ -747,14 +738,6 @@ static void dgnc_poll_handler(ulong dummy) ...@@ -747,14 +738,6 @@ static void dgnc_poll_handler(ulong dummy)
dgnc_poll_counter++; dgnc_poll_counter++;
/*
* Do not start the board state machine until
* driver tells us its up and running, and has
* everything it needs.
*/
if (dgnc_driver_state != DRIVER_READY)
goto schedule_poller;
/* 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_NumBoards; i++) {
brd = dgnc_Board[i]; brd = dgnc_Board[i];
...@@ -773,8 +756,6 @@ static void dgnc_poll_handler(ulong dummy) ...@@ -773,8 +756,6 @@ static void dgnc_poll_handler(ulong dummy)
DGNC_UNLOCK(brd->bd_lock, lock_flags); DGNC_UNLOCK(brd->bd_lock, lock_flags);
} }
schedule_poller:
/* /*
* Schedule ourself back at the nominal wakeup interval. * Schedule ourself back at the nominal wakeup interval.
*/ */
......
...@@ -484,7 +484,6 @@ struct channel_t { ...@@ -484,7 +484,6 @@ struct channel_t {
/* /*
* Our Global Variables. * Our Global Variables.
*/ */
extern int dgnc_driver_state; /* The state of the driver */
extern uint dgnc_Major; /* Our driver/mgmt major */ extern uint dgnc_Major; /* Our driver/mgmt major */
extern int dgnc_debug; /* Debug variable */ extern int dgnc_debug; /* Debug variable */
extern int dgnc_rawreadok; /* Set if user wants rawreads */ extern int dgnc_rawreadok; /* Set if user wants rawreads */
...@@ -495,6 +494,5 @@ extern uint dgnc_NumBoards; /* Total number of boards */ ...@@ -495,6 +494,5 @@ extern uint dgnc_NumBoards; /* Total number of boards */
extern struct dgnc_board *dgnc_Board[MAXBOARDS]; /* Array of board structs */ extern struct dgnc_board *dgnc_Board[MAXBOARDS]; /* Array of board structs */
extern ulong dgnc_poll_counter; /* Times the poller has run */ extern ulong dgnc_poll_counter; /* Times the poller has run */
extern char *dgnc_state_text[]; /* Array of state text */ extern char *dgnc_state_text[]; /* Array of state text */
extern char *dgnc_driver_state_text[];/* Array of driver state text */
#endif #endif
...@@ -71,13 +71,6 @@ static ssize_t dgnc_driver_pollcounter_show(struct device_driver *ddp, char *buf ...@@ -71,13 +71,6 @@ static ssize_t dgnc_driver_pollcounter_show(struct device_driver *ddp, char *buf
static DRIVER_ATTR(pollcounter, S_IRUSR, dgnc_driver_pollcounter_show, NULL); static DRIVER_ATTR(pollcounter, S_IRUSR, dgnc_driver_pollcounter_show, NULL);
static ssize_t dgnc_driver_state_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", dgnc_driver_state_text[dgnc_driver_state]);
}
static DRIVER_ATTR(state, S_IRUSR, dgnc_driver_state_show, NULL);
static ssize_t dgnc_driver_debug_show(struct device_driver *ddp, char *buf) static ssize_t dgnc_driver_debug_show(struct device_driver *ddp, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "0x%x\n", dgnc_debug); return snprintf(buf, PAGE_SIZE, "0x%x\n", dgnc_debug);
...@@ -129,7 +122,6 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver) ...@@ -129,7 +122,6 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
rc |= driver_create_file(driverfs, &driver_attr_rawreadok); rc |= driver_create_file(driverfs, &driver_attr_rawreadok);
rc |= driver_create_file(driverfs, &driver_attr_pollrate); rc |= driver_create_file(driverfs, &driver_attr_pollrate);
rc |= driver_create_file(driverfs, &driver_attr_pollcounter); rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
rc |= driver_create_file(driverfs, &driver_attr_state);
if (rc) { if (rc) {
printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n"); printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
} }
...@@ -146,7 +138,6 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver) ...@@ -146,7 +138,6 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
driver_remove_file(driverfs, &driver_attr_rawreadok); driver_remove_file(driverfs, &driver_attr_rawreadok);
driver_remove_file(driverfs, &driver_attr_pollrate); driver_remove_file(driverfs, &driver_attr_pollrate);
driver_remove_file(driverfs, &driver_attr_pollcounter); driver_remove_file(driverfs, &driver_attr_pollcounter);
driver_remove_file(driverfs, &driver_attr_state);
} }
......
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