mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 00:39:48 +00:00
gpio: pca953x: remove redundant assignments
There are few redundant assignments of ret variable which is updated anyway. Remove them for good. While here, correct indentation of the constant definition and remove one empty line. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
d4f80b8199
commit
8c7a92dad1
1 changed files with 3 additions and 6 deletions
|
@ -135,7 +135,7 @@ static int pca953x_read_single(struct pca953x_chip *chip, int reg, u32 *val,
|
|||
static int pca953x_write_single(struct pca953x_chip *chip, int reg, u32 val,
|
||||
int off)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret;
|
||||
int bank_shift = fls((chip->gpio_chip.ngpio - 1) / BANK_SZ);
|
||||
int offset = off / BANK_SZ;
|
||||
|
||||
|
@ -235,7 +235,6 @@ static int pca953x_gpio_direction_input(struct gpio_chip *gc, unsigned off)
|
|||
goto exit;
|
||||
|
||||
chip->reg_direction[off / BANK_SZ] = reg_val;
|
||||
ret = 0;
|
||||
exit:
|
||||
mutex_unlock(&chip->i2c_lock);
|
||||
return ret;
|
||||
|
@ -286,7 +285,6 @@ static int pca953x_gpio_direction_output(struct gpio_chip *gc,
|
|||
goto exit;
|
||||
|
||||
chip->reg_direction[off / BANK_SZ] = reg_val;
|
||||
ret = 0;
|
||||
exit:
|
||||
mutex_unlock(&chip->i2c_lock);
|
||||
return ret;
|
||||
|
@ -351,7 +349,6 @@ static void pca953x_gpio_set_value(struct gpio_chip *gc, unsigned off, int val)
|
|||
mutex_unlock(&chip->i2c_lock);
|
||||
}
|
||||
|
||||
|
||||
static void pca953x_gpio_set_multiple(struct gpio_chip *gc,
|
||||
unsigned long *mask, unsigned long *bits)
|
||||
{
|
||||
|
@ -820,7 +817,7 @@ static int pca953x_remove(struct i2c_client *client)
|
|||
{
|
||||
struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
struct pca953x_chip *chip = i2c_get_clientdata(client);
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
if (pdata && pdata->teardown) {
|
||||
ret = pdata->teardown(client, chip->gpio_chip.base,
|
||||
|
|
Loading…
Reference in a new issue