Skip to content

Commit

Permalink
gpio: max732x: Remove duplicate NULL check
Browse files Browse the repository at this point in the history
Since i2c_unregister_device() became NULL-aware we may remove duplicate
NULL check.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Nov 29, 2017
1 parent 4fbd8d1 commit e1c73a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpio/gpio-max732x.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,7 @@ static int max732x_probe(struct i2c_client *client,
return 0;

out_failed:
if (chip->client_dummy)
i2c_unregister_device(chip->client_dummy);
i2c_unregister_device(chip->client_dummy);
return ret;
}

Expand All @@ -734,8 +733,7 @@ static int max732x_remove(struct i2c_client *client)
gpiochip_remove(&chip->gpio_chip);

/* unregister any dummy i2c_client */
if (chip->client_dummy)
i2c_unregister_device(chip->client_dummy);
i2c_unregister_device(chip->client_dummy);

return 0;
}
Expand Down

0 comments on commit e1c73a9

Please sign in to comment.