Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1705095

[PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

Path csiph.com!news.redatomik.org!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Newsgroups linux.kernel
Subject [PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'
Date Mon, 07 Aug 2017 07:10:03 +0200
Message-ID <ubIsH-3VF-11@gated-at.bofh.it> (permalink)
X-Me-Helo localhost.localdomain
X-Me-Auth Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI=
X-Me-Date Mon, 07 Aug 2017 07:02:39 +0200
X-Me-IP 90.21.163.120
X-Mailer git-send-email 2.11.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 22
Organization linux.* mail to news gateway
X-Original-Cc linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>
X-Original-Date Mon, 7 Aug 2017 01:49:53 +0200
X-Original-Message-ID <20170806234953.30682-1-christophe.jaillet@wanadoo.fr>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1705095

Show key headers only | View raw


'devm_pinctrl_get()' never returns NULL, so this test can be simplified.

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

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 54a47b40546f..7e84662fe1c0 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -997,7 +997,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
 	struct i2c_bus_recovery_info *rinfo = &i2c_imx->rinfo;
 
 	i2c_imx->pinctrl = devm_pinctrl_get(&pdev->dev);
-	if (!i2c_imx->pinctrl || IS_ERR(i2c_imx->pinctrl)) {
+	if (IS_ERR(i2c_imx->pinctrl)) {
 		dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n");
 		return PTR_ERR(i2c_imx->pinctrl);
 	}
-- 
2.11.0

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-07 07:10 +0200
  Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-08-07 08:40 +0200
    Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Julia Lawall <julia.lawall@lip6.fr> - 2017-08-07 09:20 +0200
      Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-08 08:50 +0200
        Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Julia Lawall <julia.lawall@lip6.fr> - 2017-08-08 09:10 +0200
    Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-08 09:50 +0200
      Re: [PATCH] i2c: imx: Remove a useless test in  'i2c_imx_init_recovery_info()' Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-08-08 10:20 +0200

csiph-web