Skip to contentSkip to conversation

environment: support env on at24 eeprom

PATCH Applied Antony Pavlov 2 participants 2 messages Nov 27, 2015 – Dec 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 environment: support env on at24 eeprom

unprotect(), erase() and protect() return EOPNOTSUPP errno code for at24 I2C eeproms, so envfs_save() doesn't store data to these eeproms without this patch.

---
 common/environment.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
common/environment.c +6 -6
index f6fd781..f412e62 100644
@@ -324,16 +324,16 @@ int envfs_save(const char *filename, const char *dirname, unsigned flags)
 
 	ret = protect(envfd, ~0, 0, 0);
 
-	/* ENOSYS is no error here, many devices do not need it */
-	if (ret && errno != ENOSYS) {
+	/* ENOSYS and EOPNOTSUPP aren't errors here, many devices don't need it */
+	if (ret && errno != ENOSYS && errno != EOPNOTSUPP) {
 		printf("could not unprotect %s: %s\n", filename, errno_str());
 		goto out;
 	}
 
 	ret = erase(envfd, ~0, 0);
 
-	/* ENOSYS is no error here, many devices do not need it */
-	if (ret && errno != ENOSYS) {
+	/* ENOSYS and EOPNOTSUPP aren't errors here, many devices don't need it */
+	if (ret && errno != ENOSYS && errno != EOPNOTSUPP) {
 		printf("could not erase %s: %s\n", filename, errno_str());
 		goto out;
 	}
@@ -355,8 +355,8 @@ int envfs_save(const char *filename, const char *dirname, unsigned flags)
 
 	ret = protect(envfd, ~0, 0, 1);
 
-	/* ENOSYS is no error here, many devices do not need it */
-	if (ret && errno != ENOSYS) {
+	/* ENOSYS and EOPNOTSUPP aren't errors here, many devices don't need it */
+	if (ret && errno != ENOSYS && errno != EOPNOTSUPP) {
 		printf("could not protect %s: %s\n", filename, errno_str());
 		goto out;
 	}
Signature · 7 lines
2.6.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Antony Pavlov

unprotect(), erase() and protect() return EOPNOTSUPP errno code for at24 I2C eeproms, so envfs_save() doesn't store data to these eeproms without this patch.

---
 common/environment.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox