linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 05/15] gpio: max732x: Remove duplicate NULL check
       [not found] <20171031142149.32512-1-andriy.shevchenko@linux.intel.com>
@ 2017-10-31 14:21 ` Andy Shevchenko
  2017-11-29 12:26   ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-10-31 14:21 UTC (permalink / raw)
  To: linux-i2c, Wolfram Sang; +Cc: Andy Shevchenko, Linus Walleij, linux-gpio

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>
---
 drivers/gpio/gpio-max732x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 7f4d26ce5f23..5fc2efd837fd 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -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;
 }
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 05/15] gpio: max732x: Remove duplicate NULL check
  2017-10-31 14:21 ` [PATCH v1 05/15] gpio: max732x: Remove duplicate NULL check Andy Shevchenko
@ 2017-11-29 12:26   ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-11-29 12:26 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-i2c, Wolfram Sang, linux-gpio

On Tue, Oct 31, 2017 at 3:21 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> 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>

For some reason this was missed since halloween.
Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-29 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20171031142149.32512-1-andriy.shevchenko@linux.intel.com>
2017-10-31 14:21 ` [PATCH v1 05/15] gpio: max732x: Remove duplicate NULL check Andy Shevchenko
2017-11-29 12:26   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).