gpio: max732x: Remove duplicate NULL check
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 31 Oct 2017 14:21:39 +0000 (16:21 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 29 Nov 2017 12:25:23 +0000 (13:25 +0100)
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>
drivers/gpio/gpio-max732x.c

index c04fae1ba32a42d66d27f619bd616acb7862a9ab..9d8bcc69f2454439feb901bfa7274651d3fbbcb1 100644 (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;
 }