[PATCH 01/03] staging: dgap: remove unneeded dgap_driver_states

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Tested-by: Mark Hounschell <markh@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/dgap/dgap.c | 26 +-------------------------
 drivers/staging/dgap/dgap.h |  2 --
 2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 571f82f..b2089f5 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -372,13 +372,6 @@ static struct firmware_info fw_info[] = {
 	{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.
  */
@@ -514,8 +507,6 @@ static int dgap_init_module(void)
 
 	pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
 
-	dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
-
 	rc = dgap_start();
 	if (rc)
 		return rc;
@@ -595,8 +586,6 @@ static int dgap_start(void)
 
 	add_timer(&dgap_poll_timer);
 
-	dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
-
 	return rc;
 
 failed_device:
@@ -874,8 +863,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 	dgap_get_vpd(brd);
 	dgap_do_reset_board(brd);
 
-	if ((fw_info[card_type].conf_name) &&
-	    (dgap_driver_state == DRIVER_NEED_CONFIG_LOAD)) {
+	if (fw_info[card_type].conf_name) {
 		ret = request_firmware(&fw, fw_info[card_type].conf_name,
 					 &pdev->dev);
 		if (ret) {
@@ -897,8 +885,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
 
 		if (dgap_parsefile(&dgap_config_buf, TRUE) != 0)
 			return -EINVAL;
-
-		dgap_driver_state = -1;
 	}
 
 	ret = dgap_after_config_loaded(brd->boardnum);
@@ -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 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)
 {
 	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)
 	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
 	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
 	rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
-	rc |= driver_create_file(driverfs, &driver_attr_state);
 
 	return rc;
 }
@@ -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_pollrate);
 	driver_remove_file(driverfs, &driver_attr_pollcounter);
-	driver_remove_file(driverfs, &driver_attr_state);
 }
 
 static struct board_t *dgap_verify_board(struct device *p)
diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index caa1492..a6738f1 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -479,8 +479,6 @@ typedef unsigned char		uchar;
  */
 enum {
 	DRIVER_INITIALIZED = 0,
-	DRIVER_NEED_CONFIG_LOAD,
-	DRIVER_REQUESTED_CONFIG,
 	DRIVER_READY
 };
 
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux