linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly
@ 2019-10-01 16:40 Patrick Williams
  2019-10-01 16:40 ` [PATCH 2/2] i2c: slave-eeprom: support additional models Patrick Williams
  2019-10-02  6:20 ` [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Bjorn Ardo
  0 siblings, 2 replies; 14+ messages in thread
From: Patrick Williams @ 2019-10-01 16:40 UTC (permalink / raw)
  Cc: Björn Ardö,
	Patrick Williams, Patrick Williams, Wolfram Sang, linux-i2c,
	linux-kernel

The i2c-slave-eeprom driver emulates at24 class eeprom devices,
which come initialized with all 1s.  Do the same in the software
emulation.

Signed-off-by: Patrick Williams <alpawi@amazon.com>
---
 drivers/i2c/i2c-slave-eeprom.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
index db9763cb4dae..efee56106251 100644
--- a/drivers/i2c/i2c-slave-eeprom.c
+++ b/drivers/i2c/i2c-slave-eeprom.c
@@ -131,6 +131,8 @@ static int i2c_slave_eeprom_probe(struct i2c_client *client, const struct i2c_de
 	if (!eeprom)
 		return -ENOMEM;
 
+	memset(eeprom->buffer, 0xFF, size);
+
 	eeprom->idx_write_cnt = 0;
 	eeprom->num_address_bytes = flag_addr16 ? 2 : 1;
 	eeprom->address_mask = size - 1;
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-04-24  9:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 16:40 [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Patrick Williams
2019-10-01 16:40 ` [PATCH 2/2] i2c: slave-eeprom: support additional models Patrick Williams
2020-04-20 16:46   ` Wolfram Sang
2020-04-20 20:23     ` Patrick Williams
2019-10-02  6:20 ` [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Bjorn Ardo
2020-04-20 16:43   ` Wolfram Sang
2020-04-20 20:24     ` Patrick Williams
2020-04-20 20:31     ` Patrick Williams
2020-04-20 20:53       ` Wolfram Sang
2020-04-21 12:03         ` Bjorn Ardo
2020-04-21 12:16           ` Wolfram Sang
2020-04-22  9:30             ` Bjorn Ardo
2020-04-22  9:36               ` Wolfram Sang
2020-04-24  9:06                 ` Bjorn Ardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).