hdata/i2c: warn on i2c devs marked as unknown in the hdat

Message ID 20170920054713.17012-1-stewart@linux.vnet.ibm.com
State New
Headers show
Series
  • hdata/i2c: warn on i2c devs marked as unknown in the hdat
Related show

Commit Message

Stewart Smith Sept. 20, 2017, 5:47 a.m.
From: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>

Some I2C devices are marked as unknown in the hdat.
Log the fact to see what/where/why.

Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
[stewart@linux.vnet.ibm.com: warn rather than ignore]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hdata/i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index cc127d5..e079756 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -226,6 +226,15 @@  int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		 */
 		i2c_addr = dev->i2c_addr >> 1;
 
+		/*
+		 * Some i2c devs are marked as unknown in the hdat.
+		 * Ignoring them.
+		 */
+		if (dev->type == 0xFF)
+			prlog(PR_WARN, "HDAT I2C: e%dp%d - unknown@%x "
+			      "(port 0x%x)\n", dev->i2cm_engine,
+			      dev->i2cm_port, i2c_addr, dev->i2c_port);
+
 		prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %x\n",
 			dev->i2cm_engine, dev->i2cm_port, i2c_addr);