diff mbox

[v1] power: supply: bq25890: Use gpiod_get()

Message ID 20170220171223.40799-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Andy Shevchenko Feb. 20, 2017, 5:12 p.m. UTC
Since index is always 0, replace gpiod_get_index() by gpiod_get().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/power/supply/bq25890_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Feb. 28, 2017, 3:13 p.m. UTC | #1
On Mon, 2017-02-20 at 19:12 +0200, Andy Shevchenko wrote:
> Since index is always 0, replace gpiod_get_index() by gpiod_get().
> 

Any comments on this?

I would reduce as much as possible use of gpiod_get_index*() to sort out
things later.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/power/supply/bq25890_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c
> b/drivers/power/supply/bq25890_charger.c
> index f993a55cde20..8e2c41ded171 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -723,7 +723,7 @@ static int bq25890_irq_probe(struct bq25890_device
> *bq)
>  {
>  	struct gpio_desc *irq;
>  
> -	irq = devm_gpiod_get_index(bq->dev, BQ25890_IRQ_PIN, 0,
> GPIOD_IN);
> +	irq = devm_gpiod_get(bq->dev, BQ25890_IRQ_PIN, GPIOD_IN);
>  	if (IS_ERR(irq)) {
>  		dev_err(bq->dev, "Could not probe irq pin.\n");
>  		return PTR_ERR(irq);
Sebastian Reichel March 15, 2017, 9:18 p.m. UTC | #2
Hi,

On Mon, Feb 20, 2017 at 07:12:23PM +0200, Andy Shevchenko wrote:
> Since index is always 0, replace gpiod_get_index() by gpiod_get().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/power/supply/bq25890_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index f993a55cde20..8e2c41ded171 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -723,7 +723,7 @@ static int bq25890_irq_probe(struct bq25890_device *bq)
>  {
>  	struct gpio_desc *irq;
>  
> -	irq = devm_gpiod_get_index(bq->dev, BQ25890_IRQ_PIN, 0, GPIOD_IN);
> +	irq = devm_gpiod_get(bq->dev, BQ25890_IRQ_PIN, GPIOD_IN);
>  	if (IS_ERR(irq)) {
>  		dev_err(bq->dev, "Could not probe irq pin.\n");
>  		return PTR_ERR(irq);

Thanks, queued.

-- Sebastian
diff mbox

Patch

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index f993a55cde20..8e2c41ded171 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -723,7 +723,7 @@  static int bq25890_irq_probe(struct bq25890_device *bq)
 {
 	struct gpio_desc *irq;
 
-	irq = devm_gpiod_get_index(bq->dev, BQ25890_IRQ_PIN, 0, GPIOD_IN);
+	irq = devm_gpiod_get(bq->dev, BQ25890_IRQ_PIN, GPIOD_IN);
 	if (IS_ERR(irq)) {
 		dev_err(bq->dev, "Could not probe irq pin.\n");
 		return PTR_ERR(irq);