Commit 74f71e71 authored by Mark Hounschell's avatar Mark Hounschell Committed by Greg Kroah-Hartman

staging: dgap: remove unneeded dgap_driver_states

The only driver states we need now is READY or !READY.
No need for a sysfs method of seeing those 2 states so
the sysfs entries for dgap_driver_state is also removed.
Signed-off-by: default avatarMark Hounschell <markh@compro.net>
Tested-by: default avatarMark Hounschell <markh@compro.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 211568d0
...@@ -372,13 +372,6 @@ static struct firmware_info fw_info[] = { ...@@ -372,13 +372,6 @@ static struct firmware_info fw_info[] = {
{0,} {0,}
}; };
static char *dgap_driver_state_text[] = {
"Driver Initialized",
"Driver needs configuration load.",
"Driver requested configuration from download daemon.",
"Driver Ready."
};
/* /*
* Default transparent print information. * Default transparent print information.
*/ */
...@@ -514,8 +507,6 @@ static int dgap_init_module(void) ...@@ -514,8 +507,6 @@ static int dgap_init_module(void)
pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART); pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
rc = dgap_start(); rc = dgap_start();
if (rc) if (rc)
return rc; return rc;
...@@ -595,8 +586,6 @@ static int dgap_start(void) ...@@ -595,8 +586,6 @@ static int dgap_start(void)
add_timer(&dgap_poll_timer); add_timer(&dgap_poll_timer);
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
return rc; return rc;
failed_device: failed_device:
...@@ -874,8 +863,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type) ...@@ -874,8 +863,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
dgap_get_vpd(brd); dgap_get_vpd(brd);
dgap_do_reset_board(brd); dgap_do_reset_board(brd);
if ((fw_info[card_type].conf_name) && if (fw_info[card_type].conf_name) {
(dgap_driver_state == DRIVER_NEED_CONFIG_LOAD)) {
ret = request_firmware(&fw, fw_info[card_type].conf_name, ret = request_firmware(&fw, fw_info[card_type].conf_name,
&pdev->dev); &pdev->dev);
if (ret) { if (ret) {
...@@ -897,8 +885,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type) ...@@ -897,8 +885,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
if (dgap_parsefile(&dgap_config_buf, TRUE) != 0) if (dgap_parsefile(&dgap_config_buf, TRUE) != 0)
return -EINVAL; return -EINVAL;
dgap_driver_state = -1;
} }
ret = dgap_after_config_loaded(brd->boardnum); ret = dgap_after_config_loaded(brd->boardnum);
...@@ -5866,14 +5852,6 @@ static ssize_t dgap_driver_pollcounter_show(struct device_driver *ddp, ...@@ -5866,14 +5852,6 @@ static ssize_t dgap_driver_pollcounter_show(struct device_driver *ddp,
} }
static DRIVER_ATTR(pollcounter, S_IRUSR, dgap_driver_pollcounter_show, NULL); static DRIVER_ATTR(pollcounter, S_IRUSR, dgap_driver_pollcounter_show, NULL);
static ssize_t dgap_driver_state_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n",
dgap_driver_state_text[dgap_driver_state]);
}
static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf) static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%dms\n", dgap_poll_tick); return snprintf(buf, PAGE_SIZE, "%dms\n", dgap_poll_tick);
...@@ -5899,7 +5877,6 @@ static int dgap_create_driver_sysfiles(struct pci_driver *dgap_driver) ...@@ -5899,7 +5877,6 @@ static int dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
rc |= driver_create_file(driverfs, &driver_attr_maxboards); rc |= driver_create_file(driverfs, &driver_attr_maxboards);
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);
return rc; return rc;
} }
...@@ -5912,7 +5889,6 @@ static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver) ...@@ -5912,7 +5889,6 @@ static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
driver_remove_file(driverfs, &driver_attr_maxboards); driver_remove_file(driverfs, &driver_attr_maxboards);
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);
} }
static struct board_t *dgap_verify_board(struct device *p) static struct board_t *dgap_verify_board(struct device *p)
......
...@@ -479,8 +479,6 @@ typedef unsigned char uchar; ...@@ -479,8 +479,6 @@ typedef unsigned char uchar;
*/ */
enum { enum {
DRIVER_INITIALIZED = 0, DRIVER_INITIALIZED = 0,
DRIVER_NEED_CONFIG_LOAD,
DRIVER_REQUESTED_CONFIG,
DRIVER_READY DRIVER_READY
}; };
......
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