Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328447
b: refs/heads/master
c: 45e253a
h: refs/heads/master
i:
  328445: d85cdda
  328443: 9d8af26
  328439: 160197e
  328431: 5ab4a88
  328415: 25cbb0d
  328383: 3bf36d2
  328319: 5b6bc56
  328191: ac852d2
v: v3
  • Loading branch information
Axel Lin authored and Linus Walleij committed Sep 1, 2012
1 parent 02a5e8f commit b003e5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb7cf95a55a0d737e5f5694e71f65966a1c4e7aa
refs/heads/master: 45e253a7eb23844344bf08dad9961771a643758e
17 changes: 4 additions & 13 deletions trunk/drivers/gpio/gpio-tps65912.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ static int tps65912_gpio_input(struct gpio_chip *gc, unsigned offset)

return tps65912_clear_bits(tps65912, TPS65912_GPIO1 + offset,
GPIO_CFG_MASK);

}

static struct gpio_chip template_chip = {
Expand All @@ -92,7 +91,8 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev)
struct tps65912_gpio_data *tps65912_gpio;
int ret;

tps65912_gpio = kzalloc(sizeof(*tps65912_gpio), GFP_KERNEL);
tps65912_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps65912_gpio),
GFP_KERNEL);
if (tps65912_gpio == NULL)
return -ENOMEM;

Expand All @@ -105,28 +105,19 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev)
ret = gpiochip_add(&tps65912_gpio->gpio_chip);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret);
goto err;
return ret;
}

platform_set_drvdata(pdev, tps65912_gpio);

return ret;

err:
kfree(tps65912_gpio);
return ret;
}

static int __devexit tps65912_gpio_remove(struct platform_device *pdev)
{
struct tps65912_gpio_data *tps65912_gpio = platform_get_drvdata(pdev);
int ret;

ret = gpiochip_remove(&tps65912_gpio->gpio_chip);
if (ret == 0)
kfree(tps65912_gpio);

return ret;
return gpiochip_remove(&tps65912_gpio->gpio_chip);
}

static struct platform_driver tps65912_gpio_driver = {
Expand Down

0 comments on commit b003e5e

Please sign in to comment.