Commit e1c73a99 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4fbd8d19
...@@ -709,8 +709,7 @@ static int max732x_probe(struct i2c_client *client, ...@@ -709,8 +709,7 @@ static int max732x_probe(struct i2c_client *client,
return 0; return 0;
out_failed: out_failed:
if (chip->client_dummy) i2c_unregister_device(chip->client_dummy);
i2c_unregister_device(chip->client_dummy);
return ret; return ret;
} }
...@@ -734,8 +733,7 @@ static int max732x_remove(struct i2c_client *client) ...@@ -734,8 +733,7 @@ static int max732x_remove(struct i2c_client *client)
gpiochip_remove(&chip->gpio_chip); gpiochip_remove(&chip->gpio_chip);
/* unregister any dummy i2c_client */ /* unregister any dummy i2c_client */
if (chip->client_dummy) i2c_unregister_device(chip->client_dummy);
i2c_unregister_device(chip->client_dummy);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment