[v2] hdata/i2c: Skip unknown device type

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

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Vasant Hegde Oct. 12, 2018, 6:25 a.m.
Do not add unknown I2C devices to device tree.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
Changes in v2:
  - Rebased on top of Oliver's i2c patchset.

-Vasant

 hdata/i2c.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Stewart Smith Oct. 16, 2018, 6:05 a.m. | #1
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Do not add unknown I2C devices to device tree.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
> Changes in v2:
>   - Rebased on top of Oliver's i2c patchset.

This seems to not apply to master, able to rebase?
Stewart Smith Oct. 16, 2018, 6:08 a.m. | #2
Stewart Smith <stewart@linux.ibm.com> writes:
> Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
>> Do not add unknown I2C devices to device tree.
>>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>> Changes in v2:
>>   - Rebased on top of Oliver's i2c patchset.
>
> This seems to not apply to master, able to rebase?

I'm an idiot, ignore me.
Stewart Smith Oct. 16, 2018, 8 a.m. | #3
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Do not add unknown I2C devices to device tree.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
> Changes in v2:
>   - Rebased on top of Oliver's i2c patchset.

Merged (on top of Oliver's i2c patchset) to master as of
c94b5a9e9c32724cba92e78073f6e3c334a0ad43.

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index c129d5e5c..6b797bc3f 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -322,14 +322,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, info->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, info->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, info->label);
 
 		/*
 		 * Multi-port device require special handling since we need to