diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2016-05-27 07:13:01 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-05-27 07:13:01 -0400 |
commit | 72a71f869c95dc11b73f09fe18c593d4a0618c3f (patch) | |
tree | c535e3f6ef7e594d808fa3924712cd4a77753cf7 /drivers/i2c/i2c-dev.c | |
parent | d6760b14d4a1243f918d983bba1e35c5a5cd5a6d (diff) |
i2c: dev: don't start function name with 'return'
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>
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r-- | drivers/i2c/i2c-dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 2562a45ff152..89593dcb79f0 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) | |||
91 | return i2c_dev; | 91 | return i2c_dev; |
92 | } | 92 | } |
93 | 93 | ||
94 | static void return_i2c_dev(struct i2c_dev *i2c_dev) | 94 | static void put_i2c_dev(struct i2c_dev *i2c_dev) |
95 | { | 95 | { |
96 | spin_lock(&i2c_dev_list_lock); | 96 | spin_lock(&i2c_dev_list_lock); |
97 | list_del(&i2c_dev->list); | 97 | list_del(&i2c_dev->list); |
@@ -575,7 +575,7 @@ static int i2cdev_attach_adapter(struct device *dev, void *dummy) | |||
575 | error: | 575 | error: |
576 | cdev_del(&i2c_dev->cdev); | 576 | cdev_del(&i2c_dev->cdev); |
577 | error_cdev: | 577 | error_cdev: |
578 | return_i2c_dev(i2c_dev); | 578 | put_i2c_dev(i2c_dev); |
579 | return res; | 579 | return res; |
580 | } | 580 | } |
581 | 581 | ||
@@ -592,7 +592,7 @@ static int i2cdev_detach_adapter(struct device *dev, void *dummy) | |||
592 | if (!i2c_dev) /* attach_adapter must have failed */ | 592 | if (!i2c_dev) /* attach_adapter must have failed */ |
593 | return 0; | 593 | return 0; |
594 | 594 | ||
595 | return_i2c_dev(i2c_dev); | 595 | put_i2c_dev(i2c_dev); |
596 | device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr)); | 596 | device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr)); |
597 | cdev_del(&i2c_dev->cdev); | 597 | cdev_del(&i2c_dev->cdev); |
598 | 598 | ||