gpio: max732x: Remove duplicate NULL check

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>
This commit is contained in:
Andy Shevchenko 2017-10-31 16:21:39 +02:00 committed by Linus Walleij
parent 4fbd8d194f
commit e1c73a9906
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}
@ -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;
}