summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2023-03-24 09:09:22 +0100
committerHeiko Schocher <hs@denx.de>2023-04-11 06:43:33 +0200
commitd600b0fcbbfe877f67fb8b89e4d09aeb376c01d1 (patch)
treed4b2ecb8498b4d583df76ee85deeb57990c96a8a /drivers
parent11c25c6df0b56ee7eee2c4ddc7f075880daeb8c7 (diff)
downloadu-boot-d600b0fcbbfe877f67fb8b89e4d09aeb376c01d1.tar.gz
u-boot-d600b0fcbbfe877f67fb8b89e4d09aeb376c01d1.tar.bz2
u-boot-d600b0fcbbfe877f67fb8b89e4d09aeb376c01d1.zip
i2c: designware_i2c: remove apparently redundant read of 'i2c, speeds' DT property
This code first figures out if there is an i2c,speeds property, if so its size in u32s, and then reads the value into the local speeds[] array. Both 'size' and 'speeds' are completely unused thereafter. It's not at all clear what this is supposed to do. Of course, it could be seen as a sanity check that the DT node does have an i2c,speeds property with an appropriate number of elements, but for that one wouldn't actually need to read it into speeds[]. Also, I can't find anywhere else in the U-Boot code which makes use of values from that property (this is is the only C code referencing "i2c,speeds"), so it seems pointless to insist that it's there. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/designware_i2c_pci.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/i2c/designware_i2c_pci.c b/drivers/i2c/designware_i2c_pci.c
index 46c2545f21..28495a3f42 100644
--- a/drivers/i2c/designware_i2c_pci.c
+++ b/drivers/i2c/designware_i2c_pci.c
@@ -147,9 +147,7 @@ static int dw_i2c_acpi_fill_ssdt(const struct udevice *dev,
{
struct dw_i2c_speed_config config;
char path[ACPI_PATH_MAX];
- u32 speeds[4];
uint speed;
- int size;
int ret;
/* If no device-tree node, ignore this since we assume it isn't used */
@@ -160,18 +158,6 @@ static int dw_i2c_acpi_fill_ssdt(const struct udevice *dev,
if (ret)
return log_msg_ret("path", ret);
- size = dev_read_size(dev, "i2c,speeds");
- if (size < 0)
- return log_msg_ret("i2c,speeds", -EINVAL);
-
- size /= sizeof(u32);
- if (size > ARRAY_SIZE(speeds))
- return log_msg_ret("array", -E2BIG);
-
- ret = dev_read_u32_array(dev, "i2c,speeds", speeds, size);
- if (ret)
- return log_msg_ret("read", -E2BIG);
-
speed = dev_read_u32_default(dev, "clock-frequency", 100000);
acpigen_write_scope(ctx, path);
ret = dw_i2c_gen_speed_config(dev, speed, &config);