From: Sean Anderson Date: Thu, 5 May 2022 17:11:37 +0000 (-0400) Subject: misc: i2c_eeprom: Make i2c_eeprom_write use a const buf X-Git-Url: http://git.dujemihanovic.xyz/%22/img/sics.gif/%22/static/git-favicon.png?a=commitdiff_plain;h=dda3b389201429a65746d99ad0e4e9e2bd9819b3;p=u-boot.git misc: i2c_eeprom: Make i2c_eeprom_write use a const buf i2c_eeprom_ops->write uses a const buf, so use one for the wrapper function as well. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c index 89a450d0f8..4302e180ac 100644 --- a/drivers/misc/i2c_eeprom.c +++ b/drivers/misc/i2c_eeprom.c @@ -33,7 +33,8 @@ int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size) return ops->read(dev, offset, buf, size); } -int i2c_eeprom_write(struct udevice *dev, int offset, uint8_t *buf, int size) +int i2c_eeprom_write(struct udevice *dev, int offset, const uint8_t *buf, + int size) { const struct i2c_eeprom_ops *ops = device_get_ops(dev); diff --git a/include/i2c_eeprom.h b/include/i2c_eeprom.h index 3ad565684f..90fdb25232 100644 --- a/include/i2c_eeprom.h +++ b/include/i2c_eeprom.h @@ -42,7 +42,8 @@ int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size); * * Return: 0 on success, -ve on failure */ -int i2c_eeprom_write(struct udevice *dev, int offset, uint8_t *buf, int size); +int i2c_eeprom_write(struct udevice *dev, int offset, const uint8_t *buf, + int size); /* * i2c_eeprom_size() - get size of I2C EEPROM chip