Removed eeprom_write_enable file.
authorFlorian Pose <fp@igh-essen.com>
Thu, 01 Mar 2007 14:50:53 +0000
changeset 597 3a2c2d6ca5e9
parent 596 f2d874b2caa6
child 598 b3b1f4ce590c
Removed eeprom_write_enable file.
master/master.c
master/master.h
master/slave.c
--- a/master/master.c	Wed Feb 28 09:22:03 2007 +0000
+++ b/master/master.c	Thu Mar 01 14:50:53 2007 +0000
@@ -70,12 +70,10 @@
 /** \cond */
 
 EC_SYSFS_READ_ATTR(info);
-EC_SYSFS_READ_WRITE_ATTR(eeprom_write_enable);
 EC_SYSFS_READ_WRITE_ATTR(debug_level);
 
 static struct attribute *ec_def_attrs[] = {
     &attr_info,
-    &attr_eeprom_write_enable,
     &attr_debug_level,
     NULL,
 };
@@ -154,8 +152,6 @@
     master->release_cb = NULL;
     master->cb_data = NULL;
 
-    master->eeprom_write_enable = 0;
-
     master->sdo_request = NULL;
     master->sdo_seq_user = 0;
     master->sdo_seq_master = 0;
@@ -1003,9 +999,6 @@
     else if (attr == &attr_debug_level) {
         return sprintf(buffer, "%i\n", master->debug_level);
     }
-    else if (attr == &attr_eeprom_write_enable) {
-        return sprintf(buffer, "%i\n", master->eeprom_write_enable);
-    }
 
     return 0;
 }
@@ -1025,26 +1018,7 @@
 {
     ec_master_t *master = container_of(kobj, ec_master_t, kobj);
 
-    if (attr == &attr_eeprom_write_enable) {
-        if (!strcmp(buffer, "1\n")) {
-            master->eeprom_write_enable = 1;
-            EC_INFO("Slave EEPROM writing enabled.\n");
-            return size;
-        }
-        else if (!strcmp(buffer, "0\n")) {
-            master->eeprom_write_enable = 0;
-            EC_INFO("Slave EEPROM writing disabled.\n");
-            return size;
-        }
-
-        EC_ERR("Invalid value for eeprom_write_enable!\n");
-
-        if (master->eeprom_write_enable) {
-            master->eeprom_write_enable = 0;
-            EC_INFO("Slave EEPROM writing disabled.\n");
-        }
-    }
-    else if (attr == &attr_debug_level) {
+    if (attr == &attr_debug_level) {
         if (!strcmp(buffer, "0\n")) {
             master->debug_level = 0;
         }
--- a/master/master.h	Wed Feb 28 09:22:03 2007 +0000
+++ b/master/master.h	Thu Mar 01 14:50:53 2007 +0000
@@ -138,8 +138,6 @@
     void (*release_cb)(void *); /**< lock release callback */
     void *cb_data; /**< data parameter of locking callbacks */
 
-    uint8_t eeprom_write_enable; /**< allow write operations to EEPROMs */
-
     ec_sdo_request_t *sdo_request; /**< pointer to the current SDO request */
     unsigned int sdo_seq_user; /**< sequence number for user space */
     unsigned int sdo_seq_master; /**< sequence number for master */
--- a/master/slave.c	Wed Feb 28 09:22:03 2007 +0000
+++ b/master/slave.c	Thu Mar 01 14:50:53 2007 +0000
@@ -789,12 +789,6 @@
     const uint16_t *data_words, *next_header;
     uint16_t *new_data;
 
-    if (!slave->master->eeprom_write_enable) {
-        EC_ERR("Writing EEPROMs not allowed! Enable via"
-               " eeprom_write_enable SysFS entry.\n");
-        return -1;
-    }
-
     if (slave->master->mode != EC_MASTER_MODE_IDLE) {
         EC_ERR("Writing EEPROMs only allowed in idle mode!\n");
         return -1;