Skip to content

Commit 74f71e7

Browse files
Mark Hounschellgregkh
authored andcommitted
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: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 211568d commit 74f71e7

2 files changed

Lines changed: 1 addition & 27 deletions

File tree

‎drivers/staging/dgap/dgap.c‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,6 @@ static struct firmware_info fw_info[] = {
372372
{0,}
373373
};
374374

375-
static char *dgap_driver_state_text[] = {
376-
"Driver Initialized",
377-
"Driver needs configuration load.",
378-
"Driver requested configuration from download daemon.",
379-
"Driver Ready."
380-
};
381-
382375
/*
383376
* Default transparent print information.
384377
*/
@@ -514,8 +507,6 @@ static int dgap_init_module(void)
514507

515508
pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
516509

517-
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
518-
519510
rc = dgap_start();
520511
if (rc)
521512
return rc;
@@ -595,8 +586,6 @@ static int dgap_start(void)
595586

596587
add_timer(&dgap_poll_timer);
597588

598-
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
599-
600589
return rc;
601590

602591
failed_device:
@@ -874,8 +863,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
874863
dgap_get_vpd(brd);
875864
dgap_do_reset_board(brd);
876865

877-
if ((fw_info[card_type].conf_name) &&
878-
(dgap_driver_state == DRIVER_NEED_CONFIG_LOAD)) {
866+
if (fw_info[card_type].conf_name) {
879867
ret = request_firmware(&fw, fw_info[card_type].conf_name,
880868
&pdev->dev);
881869
if (ret) {
@@ -897,8 +885,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
897885

898886
if (dgap_parsefile(&dgap_config_buf, TRUE) != 0)
899887
return -EINVAL;
900-
901-
dgap_driver_state = -1;
902888
}
903889

904890
ret = dgap_after_config_loaded(brd->boardnum);
@@ -5866,14 +5852,6 @@ static ssize_t dgap_driver_pollcounter_show(struct device_driver *ddp,
58665852
}
58675853
static DRIVER_ATTR(pollcounter, S_IRUSR, dgap_driver_pollcounter_show, NULL);
58685854

5869-
5870-
static ssize_t dgap_driver_state_show(struct device_driver *ddp, char *buf)
5871-
{
5872-
return snprintf(buf, PAGE_SIZE, "%s\n",
5873-
dgap_driver_state_text[dgap_driver_state]);
5874-
}
5875-
static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
5876-
58775855
static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf)
58785856
{
58795857
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)
58995877
rc |= driver_create_file(driverfs, &driver_attr_maxboards);
59005878
rc |= driver_create_file(driverfs, &driver_attr_pollrate);
59015879
rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
5902-
rc |= driver_create_file(driverfs, &driver_attr_state);
59035880

59045881
return rc;
59055882
}
@@ -5912,7 +5889,6 @@ static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
59125889
driver_remove_file(driverfs, &driver_attr_maxboards);
59135890
driver_remove_file(driverfs, &driver_attr_pollrate);
59145891
driver_remove_file(driverfs, &driver_attr_pollcounter);
5915-
driver_remove_file(driverfs, &driver_attr_state);
59165892
}
59175893

59185894
static struct board_t *dgap_verify_board(struct device *p)

‎drivers/staging/dgap/dgap.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,6 @@ typedef unsigned char uchar;
479479
*/
480480
enum {
481481
DRIVER_INITIALIZED = 0,
482-
DRIVER_NEED_CONFIG_LOAD,
483-
DRIVER_REQUESTED_CONFIG,
484482
DRIVER_READY
485483
};
486484

0 commit comments

Comments
 (0)