diff mbox series

[2/4] hdata/i2c: Replace i2c_ prefix with dev_

Message ID 20180424032502.17619-2-oohall@gmail.com
State Accepted
Headers show
Series [1/4] hdata/i2c: Ignore CFAM I2C master | expand

Commit Message

Oliver O'Halloran April 24, 2018, 3:25 a.m. UTC
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 <oohall@gmail.com>
---
 hdata/i2c.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Andrew Donnellan April 27, 2018, 1:55 a.m. UTC | #1
On 24/04/18 13:25, Oliver O'Halloran wrote:
> 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 <oohall@gmail.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
diff mbox series

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 6ea34507345c..c08b53d5c8fb 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)