[Skiboot] [PATCH] hdata/i2c: Work around broken I2C array version

Oliver O'Halloran oohall at gmail.com
Wed Aug 2 22:58:46 AEST 2017


Work around a bug in the I2C devices array that shows the
array version as being v2 when only the v1 data is populated.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hdata/i2c.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 1c26e2ea9df0..8dcbf4b2d628 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -193,10 +193,9 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		version = be32_to_cpu(ahdr->version);
 	}
 
-	if (version != 1) {
-		prerror("I2C: HDAT version %d not supported! THIS IS A BUG\n",
+	if (version > 1) {
+		prerror("I2C: v%d found, but not supported. Parsing as v1\n",
 			version);
-		return -1;
 	}
 
 	count = HDIF_get_iarray_size(hdr, idata_index);
@@ -237,6 +236,9 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		}
 
 		node = dt_new_addr(bus, name, i2c_addr);
+		if (!node)
+			continue;
+
 		dt_add_property_cells(node, "reg", i2c_addr);
 		dt_add_property_cells(node, "link-id",
 			be32_to_cpu(dev->i2c_link));
-- 
2.9.4



More information about the Skiboot mailing list