summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-05-28 11:48:55 +0200
committerMichal Simek <michal.simek@xilinx.com>2020-08-20 09:49:20 +0200
commitf692b479f02d9b2689b0686f1f6ff2f06c6ecc59 (patch)
tree1501c8e1fb5f34a4f7163fc059a6ba1a290bd4f2 /drivers
parent2d06361a11e88e6ca5bbd11e3ed5717d7715bfe1 (diff)
i2c: eeprom: Use reg property instead of offset and size
Remove adhoc dt binding for fixed-partition definition for i2c eeprom. fixed-partition are using reg property instead of offset/size pair. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/i2c_eeprom.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index 45c34d388c..3651ba4871 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -301,19 +301,20 @@ static int i2c_eeprom_partition_probe(struct udevice *dev)
static int i2c_eeprom_partition_ofdata_to_platdata(struct udevice *dev)
{
struct i2c_eeprom_partition *priv = dev_get_priv(dev);
- u32 offset, size;
+ u32 reg[2];
int ret;
- ret = dev_read_u32(dev, "offset", &offset);
+ ret = dev_read_u32_array(dev, "reg", reg, 2);
if (ret)
return ret;
- ret = dev_read_u32(dev, "size", &size);
- if (ret)
- return ret;
+ if (!reg[1])
+ return -EINVAL;
+
+ priv->offset = reg[0];
+ priv->size = reg[1];
- priv->offset = offset;
- priv->size = size;
+ debug("%s: base %x, size %x\n", __func__, priv->offset, priv->size);
return 0;
}