public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: bcm590xx: Simplify a test
@ 2016-11-01  6:49 Christophe JAILLET
  2016-11-14 17:40 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2016-11-01  6:49 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET

'i2c_new_dummy()' does not return an error pointer, so the test can be
simplified to be more consistent.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/mfd/bcm590xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c
index 0d76d690176b..c572a35a9341 100644
--- a/drivers/mfd/bcm590xx.c
+++ b/drivers/mfd/bcm590xx.c
@@ -67,7 +67,7 @@ static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri,
 	/* Secondary I2C slave address is the base address with A(2) asserted */
 	bcm590xx->i2c_sec = i2c_new_dummy(i2c_pri->adapter,
 					  i2c_pri->addr | BIT(2));
-	if (IS_ERR_OR_NULL(bcm590xx->i2c_sec)) {
+	if (!bcm590xx->i2c_sec) {
 		dev_err(&i2c_pri->dev, "failed to add secondary I2C device\n");
 		return -ENODEV;
 	}
-- 
2.9.3

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

* Re: [PATCH] mfd: bcm590xx: Simplify a test
  2016-11-01  6:49 [PATCH] mfd: bcm590xx: Simplify a test Christophe JAILLET
@ 2016-11-14 17:40 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2016-11-14 17:40 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors

On Tue, 01 Nov 2016, Christophe JAILLET wrote:

> 'i2c_new_dummy()' does not return an error pointer, so the test can be
> simplified to be more consistent.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/mfd/bcm590xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c
> index 0d76d690176b..c572a35a9341 100644
> --- a/drivers/mfd/bcm590xx.c
> +++ b/drivers/mfd/bcm590xx.c
> @@ -67,7 +67,7 @@ static int bcm590xx_i2c_probe(struct i2c_client *i2c_pri,
>  	/* Secondary I2C slave address is the base address with A(2) asserted */
>  	bcm590xx->i2c_sec = i2c_new_dummy(i2c_pri->adapter,
>  					  i2c_pri->addr | BIT(2));
> -	if (IS_ERR_OR_NULL(bcm590xx->i2c_sec)) {
> +	if (!bcm590xx->i2c_sec) {
>  		dev_err(&i2c_pri->dev, "failed to add secondary I2C device\n");
>  		return -ENODEV;
>  	}

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2016-11-14 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01  6:49 [PATCH] mfd: bcm590xx: Simplify a test Christophe JAILLET
2016-11-14 17:40 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox