summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2016-05-27 13:13:01 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 16:40:26 +0200
commit49661be5ab43f9aa161deb06edd0dea90849519c (patch)
treedfb3c92d3a4739d6b4d29ad08b14af7ab0cdeb05
parent082041c05f308ceb5f8f337b90da40c1e9fd0f85 (diff)
i2c: dev: don't start function name with 'return'
commit 72a71f869c95dc11b73f09fe18c593d4a0618c3f upstream. I stumbled multiple times over 'return_i2c_dev', especially before the actual 'return res'. It makes the code hard to read, so reanme the function to 'put_i2c_dev' which also better matches 'get_free_i2c_dev'. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/i2c/i2c-dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 5fecc1d9e0a1..382c66d5a470 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -91,7 +91,7 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap)
return i2c_dev;
}
-static void return_i2c_dev(struct i2c_dev *i2c_dev)
+static void put_i2c_dev(struct i2c_dev *i2c_dev)
{
spin_lock(&i2c_dev_list_lock);
list_del(&i2c_dev->list);
@@ -582,7 +582,7 @@ static int i2cdev_attach_adapter(struct device *dev, void *dummy)
error:
cdev_del(&i2c_dev->cdev);
error_cdev:
- return_i2c_dev(i2c_dev);
+ put_i2c_dev(i2c_dev);
return res;
}
@@ -599,7 +599,7 @@ static int i2cdev_detach_adapter(struct device *dev, void *dummy)
if (!i2c_dev) /* attach_adapter must have failed */
return 0;
- return_i2c_dev(i2c_dev);
+ put_i2c_dev(i2c_dev);
device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr));
cdev_del(&i2c_dev->cdev);