From 3a4b4db368125c2ddb1fb4831253fa51d3268152 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Tue, 24 Apr 2018 13:25:00 +1000 Subject: hdata/i2c: Replace i2c_ prefix with dev_ The current naming scheme makes it easy to conflate "i2cm_port" and "i2c_port." The latter is used to describe multi-port I2C devices such as GPIO expanders and multi-channel PCIe hotplug controllers. Rename i2c_port to dev_port to make the two a bit more distinct. Also rename i2c_addr to dev_addr for consistency. Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- hdata/i2c.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hdata') diff --git a/hdata/i2c.c b/hdata/i2c.c index 6ea3450..c08b53d 100644 --- a/hdata/i2c.c +++ b/hdata/i2c.c @@ -31,8 +31,8 @@ struct i2c_dev { /* i2c slave info */ uint8_t type; - uint8_t i2c_addr; - uint8_t i2c_port; + uint8_t dev_addr; + uint8_t dev_port; uint8_t __reserved; __be32 purpose; @@ -207,7 +207,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, const struct i2c_dev *dev; const char *label, *name, *compat; const struct host_i2c_hdr *ahdr; - uint32_t i2c_addr; + uint32_t dev_addr; uint32_t version; uint32_t size; uint32_t purpose; @@ -280,7 +280,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, * justified quantity (i.e it includes the R/W bit). So we need * to strip it off to get an address linux can use. */ - i2c_addr = dev->i2c_addr >> 1; + dev_addr = dev->dev_addr >> 1; purpose = be32_to_cpu(dev->purpose); type = map_type(dev->type); @@ -315,18 +315,18 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index, */ if (!type || dev->type == 0xFF) prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", - dev->i2cm_engine, dev->i2cm_port, name, i2c_addr, + dev->i2cm_engine, dev->i2cm_port, name, dev_addr, purpose, label); else prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n", - dev->i2cm_engine, dev->i2cm_port, name, i2c_addr, + dev->i2cm_engine, dev->i2cm_port, name, dev_addr, purpose, label); - node = dt_new_addr(bus, name, i2c_addr); + node = dt_new_addr(bus, name, dev_addr); if (!node) continue; - dt_add_property_cells(node, "reg", i2c_addr); + dt_add_property_cells(node, "reg", dev_addr); dt_add_property_cells(node, "link-id", be32_to_cpu(dev->i2c_link)); if (compat) -- cgit v1.1