From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013AbcKNRh7 (ORCPT ); Mon, 14 Nov 2016 12:37:59 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:34016 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934382AbcKNRhw (ORCPT ); Mon, 14 Nov 2016 12:37:52 -0500 Date: Mon, 14 Nov 2016 17:40:46 +0000 From: Lee Jones To: Christophe JAILLET Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] mfd: bcm590xx: Simplify a test Message-ID: <20161114174046.GB4094@dell> References: <20161101064905.11961-1-christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161101064905.11961-1-christophe.jaillet@wanadoo.fr> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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