linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 13/15] iio: imu: inv_mpu6050: Remove duplicate NULL check
       [not found] <20171031142149.32512-1-andriy.shevchenko@linux.intel.com>
@ 2017-10-31 14:21 ` Andy Shevchenko
  2017-11-19 16:04   ` Jonathan Cameron
  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, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio

Since i2c_unregister_device() became NULL-aware we may remove duplicate
NULL check.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
index dd6fc6d21f9d..d78a10403bac 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
@@ -196,8 +196,7 @@ void inv_mpu_acpi_delete_mux_client(struct i2c_client *client)
 {
 	struct inv_mpu6050_state *st = iio_priv(dev_get_drvdata(&client->dev));
 
-	if (st->mux_client)
-		i2c_unregister_device(st->mux_client);
+	i2c_unregister_device(st->mux_client);
 }
 #else
 
-- 
2.14.2

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

* Re: [PATCH v1 13/15] iio: imu: inv_mpu6050: Remove duplicate NULL check
  2017-10-31 14:21 ` [PATCH v1 13/15] iio: imu: inv_mpu6050: Remove duplicate NULL check Andy Shevchenko
@ 2017-11-19 16:04   ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-11-19 16:04 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-i2c, Wolfram Sang, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio

On Tue, 31 Oct 2017 16:21:47 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Since i2c_unregister_device() became NULL-aware we may remove duplicate
> NULL check.
> 
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Hartmut Knaack <knaack.h@gmx.de>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> Cc: linux-iio@vger.kernel.org
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied to the togreg branch of iio.git.  Thanks,

Jonathan
> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> index dd6fc6d21f9d..d78a10403bac 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> @@ -196,8 +196,7 @@ void inv_mpu_acpi_delete_mux_client(struct i2c_client *client)
>  {
>  	struct inv_mpu6050_state *st = iio_priv(dev_get_drvdata(&client->dev));
>  
> -	if (st->mux_client)
> -		i2c_unregister_device(st->mux_client);
> +	i2c_unregister_device(st->mux_client);
>  }
>  #else
>  


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

end of thread, other threads:[~2017-11-19 16:04 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 13/15] iio: imu: inv_mpu6050: Remove duplicate NULL check Andy Shevchenko
2017-11-19 16:04   ` Jonathan Cameron

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