Skip to contentSkip to conversation

i2c: avoid confusing naming in header

PATCH Applied Wolfram Sang 1 participant 2 messages May 25, 2020 – May 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: avoid confusing naming in header

i2c_client pointers are usually named 'client'. Use it here to get rid of the ambiguity of 'dev->dev'.

---

Tested by booting a Renesas Lager board; no regressions discovered.

 include/linux/i2c.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/i2c.h +4 -4
index 49d29054e657..c10617bb980a 100644
@@ -351,14 +351,14 @@ static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
 	return to_i2c_client(dev);
 }
 
-static inline void *i2c_get_clientdata(const struct i2c_client *dev)
+static inline void *i2c_get_clientdata(const struct i2c_client *client)
 {
-	return dev_get_drvdata(&dev->dev);
+	return dev_get_drvdata(&client->dev);
 }
 
-static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
+static inline void i2c_set_clientdata(struct i2c_client *client, void *data)
 {
-	dev_set_drvdata(&dev->dev, data);
+	dev_set_drvdata(&client->dev, data);
 }
 
 /* I2C slave support */
Signature · 1 line
2.20.1
author Applied
#1 lore raw
Quoted 4 lines · Wolfram Sang

i2c_client pointers are usually named 'client'. Use it here to get rid of the ambiguity of 'dev->dev'.

Applied to for-next, thanks!