Skip to contentSkip to conversation

i2c: make i2c_get_adapter prototype clearer

PATCH New Jean Delvare 1 participant 1 message Feb 17, 2011

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

PATCH 1/1 i2c: make i2c_get_adapter prototype clearer

Rename the parameter of i2c_get_adapter() to "nr", to make it clear we are passing an adapter number and not an adapter ID (which have gone away by now.)

---
 drivers/i2c/i2c-core.c |    4 ++--
 include/linux/i2c.h    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/i2c-core.c +2 -2
@@ -1583,12 +1583,12 @@ i2c_new_probed_device(struct i2c_adapter
 }
 EXPORT_SYMBOL_GPL(i2c_new_probed_device);
 
-struct i2c_adapter *i2c_get_adapter(int id)
+struct i2c_adapter *i2c_get_adapter(int nr)
 {
 	struct i2c_adapter *adapter;
 
 	mutex_lock(&core_lock);
-	adapter = idr_find(&i2c_adapter_idr, id);
+	adapter = idr_find(&i2c_adapter_idr, nr);
 	if (adapter && !try_module_get(adapter->owner))
 		adapter = NULL;
 
include/linux/i2c.h +1 -1
@@ -448,7 +448,7 @@ extern void i2c_release_client(struct i2
 extern void i2c_clients_command(struct i2c_adapter *adap,
 				unsigned int cmd, void *arg);
 
-extern struct i2c_adapter *i2c_get_adapter(int id);
+extern struct i2c_adapter *i2c_get_adapter(int nr);
 extern void i2c_put_adapter(struct i2c_adapter *adap);
 
 
Signature · 1 line
Jean Delvare