[1/2] hdata/i2c: Skip unknown device type

Message ID 20180921141441.24398-1-hegdevasant@linux.vnet.ibm.com
State New
Headers show
Series
  • [1/2] hdata/i2c: Skip unknown device type
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Vasant Hegde Sept. 21, 2018, 2:14 p.m.
Do not add unknown I2C devices to device tree.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/i2c.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 9bbec6657..8d4403e4e 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -313,14 +313,16 @@  int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		 * outdated or the device is marked as unknown (0xFF) in the
 		 * hdat. Log both cases to see what/where/why.
 		 */
-		if (!type || dev->type == 0xFF)
+		if (!type || dev->type == 0xFF) {
 			prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n",
 			      dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
 			      dev->dev_port, purpose, label);
-		else
-			prlog(PR_DEBUG, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n",
-			      dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
-			      dev->dev_port, purpose, label);
+			continue;
+		}
+
+		prlog(PR_DEBUG, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n",
+		      dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
+		      dev->dev_port, purpose, label);
 
 		/*
 		 * Multi-port device require special handling since we need to