Skip to contentSkip to conversation

power: supply: bq25890: Use gpiod_get()

PATCH In review Andy Shevchenko 2 participants 3 messages Feb 20, 2017 – Mar 15, 2017 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: bq25890: Use gpiod_get()

Since index is always 0, replace gpiod_get_index() by gpiod_get().

---
 drivers/power/supply/bq25890_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq25890_charger.c +1 -1
index f993a55cde20..8e2c41ded171 100644
@@ -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);
Signature · 1 line
2.11.0
#1 lore raw
Quoted 2 lines · Andy Shevchenko

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.

Quoted 21 lines

---
 drivers/power/supply/bq25890_charger.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq25890_charger.c +0 -0
index f993a55cde20..8e2c41ded171 100644
@@ -723,7 +723,7 @@ static int bq25890_irq_probe(struct bq25890_device
 *bq)
  {
  	struct gpio_desc *irq;

drivers/power/supply/bq25890_charger.c +0 -1
-	irq = devm_gpiod_get_index(bq->dev, BQ25890_IRQ_PIN, 0,

GPIOD_IN);

drivers/power/supply/bq25890_charger.c +1 -0
+	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);

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
In reply to Andy Shevchenko

Hi,

Quoted 12 lines · Andy Shevchenko

Since index is always 0, replace gpiod_get_index() by gpiod_get().

---
 drivers/power/supply/bq25890_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq25890_charger.c +0 -0
index f993a55cde20..8e2c41ded171 100644

drivers/power/supply/bq25890_charger.c static int bq25890_irq_probe(struct bq25890_device *bq) · line 729

Quoted 8 lines
drivers/power/supply/bq25890_charger.c +1 -1
@@ -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