Skip to contentSkip to conversation

gpio: intel-mid: switch to devm_gpiochip_add_data()

PATCH In review Andy Shevchenko 2 participants 2 messages Jun 19, 2016 – Jun 23, 2016 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: intel-mid: switch to devm_gpiochip_add_data()

The error handling is not correct since the commit 3f7dbfd8eea9 ("gpio:
intel-mid: switch to using gpiolib irqchip helpers"). Switch to devres API to fix the potential resource leak.

Fixes commit 3f7dbfd8eea9 ("gpio: intel-mid: switch to using gpiolib irqchip helpers")
---
 drivers/gpio/gpio-intel-mid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-intel-mid.c +1 -1
index cdaba13..a99cf4b 100644
@@ -401,7 +401,7 @@ static int intel_gpio_probe(struct pci_dev *pdev,
 	spin_lock_init(&priv->lock);
 
 	pci_set_drvdata(pdev, priv);
-	retval = gpiochip_add_data(&priv->chip, priv);
+	retval = devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv);
 	if (retval) {
 		dev_err(&pdev->dev, "gpiochip_add error %d\n", retval);
 		return retval;
Signature · 1 line
2.8.1
#1 lore raw
Quoted 6 lines · Andy Shevchenko

The error handling is not correct since the commit 3f7dbfd8eea9 ("gpio:
intel-mid: switch to using gpiolib irqchip helpers"). Switch to devres API to fix the potential resource leak.

Fixes commit 3f7dbfd8eea9 ("gpio: intel-mid: switch to using gpiolib irqchip helpers")

Patch applied.

Yours,
Linus Walleij