Skip to contentSkip to conversation

eeprom: at24: add the "read-only" dt parameter support

PATCH Applied Antony Pavlov 2 participants 2 messages Apr 24, 2017 – Apr 25, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eeprom: at24: add the "read-only" dt parameter support

---
 drivers/eeprom/at24.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/eeprom/at24.c +4 -0
index 1227286fbe..050a35aed8 100644
@@ -454,6 +454,10 @@ static int at24_probe(struct device_d *dev)
 	at24->cdev.size = chip.byte_len;
 
 	writable = !(chip.flags & AT24_FLAG_READONLY);
+
+	if (of_get_property(dev->device_node, "read-only", NULL))
+		writable = 0;
+
 	if (writable) {
 		unsigned write_max = chip.page_size;
 
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 4 lines · Antony Pavlov
---
 drivers/eeprom/at24.c | 4 ++++
 1 file changed, 4 insertions(+)

Applied, thanks

Sascha

Quoted 20 lines
drivers/eeprom/at24.c +4 -0
index 1227286fbe..050a35aed8 100644
@@ -454,6 +454,10 @@ static int at24_probe(struct device_d *dev)
 	at24->cdev.size = chip.byte_len;
 
 	writable = !(chip.flags & AT24_FLAG_READONLY);
+
+	if (of_get_property(dev->device_node, "read-only", NULL))
+		writable = 0;
+
 	if (writable) {
 		unsigned write_max = chip.page_size;
 
Signature · 1 line
2.11.0
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