Message ID | 20200228130414.1970-1-yamada.masahiro@socionext.com |
---|---|
State | Accepted |
Commit | ed6dd4e460bd94150dc09fce547a27e2fcca66eb |
Headers | show |
Series | [1/2] misc: i2c_eeprom: remove pagewidth field from i2c_eeprom | expand |
Hello Masahiro, Am 28.02.2020 um 14:04 schrieb Masahiro Yamada: > This struct member is not used in any effective way. Remove it. > > Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com> > --- > > drivers/misc/i2c_eeprom.c | 8 +++----- > include/i2c_eeprom.h | 2 -- > 2 files changed, 3 insertions(+), 7 deletions(-) Applied to u-boot-i2c next, thanks! bye, Heiko
diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c index 6c0459dc555b..728e0fd79abd 100644 --- a/drivers/misc/i2c_eeprom.c +++ b/drivers/misc/i2c_eeprom.c @@ -99,13 +99,11 @@ static int i2c_eeprom_std_ofdata_to_platdata(struct udevice *dev) u32 pagesize; u32 size; - if (dev_read_u32(dev, "pagesize", &pagesize) == 0) { + if (dev_read_u32(dev, "pagesize", &pagesize) == 0) priv->pagesize = pagesize; - } else { + else /* 6 bit -> page size of up to 2^63 (should be sufficient) */ - priv->pagewidth = data->pagewidth; - priv->pagesize = (1 << priv->pagewidth); - } + priv->pagesize = 1 << data->pagewidth; if (dev_read_u32(dev, "size", &size) == 0) priv->size = size; diff --git a/include/i2c_eeprom.h b/include/i2c_eeprom.h index b96254ae79f5..cd620d519fca 100644 --- a/include/i2c_eeprom.h +++ b/include/i2c_eeprom.h @@ -16,8 +16,6 @@ struct i2c_eeprom_ops { struct i2c_eeprom { /* The EEPROM's page size in byte */ unsigned long pagesize; - /* The EEPROM's page width in bits (pagesize = 2^pagewidth) */ - unsigned pagewidth; /* The EEPROM's capacity in bytes */ unsigned long size; };
This struct member is not used in any effective way. Remove it. Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com> --- drivers/misc/i2c_eeprom.c | 8 +++----- include/i2c_eeprom.h | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-)