]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
misc: i2c_eeprom: remove pagewidth field from i2c_eeprom
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 28 Feb 2020 13:04:13 +0000 (22:04 +0900)
committerHeiko Schocher <hs@denx.de>
Mon, 16 Mar 2020 07:03:05 +0000 (08:03 +0100)
This struct member is not used in any effective way. Remove it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/misc/i2c_eeprom.c
include/i2c_eeprom.h

index 6c0459dc555b7b7cd5acda62a07aa0852df5bb00..728e0fd79abd2333dec2532f054ca009dc5b3fb7 100644 (file)
@@ -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;
index b96254ae79f5bb7cc071e005efd41934f92e5d56..cd620d519fca478307a9f511ad69585c92d8d872 100644 (file)
@@ -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;
 };