linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch V1] i2c: imx: improve code readability
@ 2015-11-02  9:05 Gao Pan
  2015-11-02  9:29 ` Uwe Kleine-König
  2016-01-03 18:17 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Gao Pan @ 2015-11-02  9:05 UTC (permalink / raw)
  To: wsa, u.kleine-koenig; +Cc: linux-i2c, B20596, b38611, b54642

Replace of_get_named_gpio_flags with of_get_named_gpio because
the latter has less parameters, which improves code readability.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Gao Pan <b54642@freescale.com>
---
 drivers/i2c/busses/i2c-imx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 1e4d99d..b0fe090 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -996,10 +996,8 @@ static void i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
 			PINCTRL_STATE_DEFAULT);
 	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
 			"gpio");
-	rinfo->sda_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
-			"sda-gpios", 0, NULL);
-	rinfo->scl_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
-			"scl-gpios", 0, NULL);
+	rinfo->sda_gpio = of_get_named_gpio(pdev->dev.of_node, "sda-gpios", 0);
+	rinfo->scl_gpio = of_get_named_gpio(pdev->dev.of_node, "scl-gpios", 0);
 
 	if (!gpio_is_valid(rinfo->sda_gpio) ||
 	    !gpio_is_valid(rinfo->scl_gpio) ||
-- 
1.9.1

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

* Re: [Patch V1] i2c: imx: improve code readability
  2015-11-02  9:05 [Patch V1] i2c: imx: improve code readability Gao Pan
@ 2015-11-02  9:29 ` Uwe Kleine-König
  2016-01-03 18:17 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2015-11-02  9:29 UTC (permalink / raw)
  To: Gao Pan; +Cc: wsa, linux-i2c, B20596, b38611

Hello,

On Mon, Nov 02, 2015 at 05:05:30PM +0800, Gao Pan wrote:
> Replace of_get_named_gpio_flags with of_get_named_gpio because
> the latter has less parameters, which improves code readability.
> 
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Signed-off-by: Gao Pan <b54642@freescale.com>
> ---
>  drivers/i2c/busses/i2c-imx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 1e4d99d..b0fe090 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -996,10 +996,8 @@ static void i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
>  			PINCTRL_STATE_DEFAULT);
>  	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
>  			"gpio");
> -	rinfo->sda_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
> -			"sda-gpios", 0, NULL);
> -	rinfo->scl_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
> -			"scl-gpios", 0, NULL);
> +	rinfo->sda_gpio = of_get_named_gpio(pdev->dev.of_node, "sda-gpios", 0);
> +	rinfo->scl_gpio = of_get_named_gpio(pdev->dev.of_node, "scl-gpios", 0);

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [Patch V1] i2c: imx: improve code readability
  2015-11-02  9:05 [Patch V1] i2c: imx: improve code readability Gao Pan
  2015-11-02  9:29 ` Uwe Kleine-König
@ 2016-01-03 18:17 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2016-01-03 18:17 UTC (permalink / raw)
  To: Gao Pan; +Cc: u.kleine-koenig, linux-i2c, B20596, b38611

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

On Mon, Nov 02, 2015 at 05:05:30PM +0800, Gao Pan wrote:
> Replace of_get_named_gpio_flags with of_get_named_gpio because
> the latter has less parameters, which improves code readability.
> 
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Signed-off-by: Gao Pan <b54642@freescale.com>

Applied to for-next, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-01-03 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02  9:05 [Patch V1] i2c: imx: improve code readability Gao Pan
2015-11-02  9:29 ` Uwe Kleine-König
2016-01-03 18:17 ` Wolfram Sang

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