Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328446
b: refs/heads/master
c: eb7cf95
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Linus Walleij committed Sep 1, 2012
1 parent d85cdda commit 02a5e8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 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: 6ab49f4201676a96f62d0f327206a28dc02f2e2f
refs/heads/master: eb7cf95a55a0d737e5f5694e71f65966a1c4e7aa
15 changes: 3 additions & 12 deletions trunk/drivers/gpio/gpio-da9052.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int __devinit da9052_gpio_probe(struct platform_device *pdev)
struct da9052_pdata *pdata;
int ret;

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

Expand All @@ -221,28 +221,19 @@ static int __devinit da9052_gpio_probe(struct platform_device *pdev)
ret = gpiochip_add(&gpio->gp);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
goto err_mem;
return ret;
}

platform_set_drvdata(pdev, gpio);

return 0;

err_mem:
kfree(gpio);
return ret;
}

static int __devexit da9052_gpio_remove(struct platform_device *pdev)
{
struct da9052_gpio *gpio = platform_get_drvdata(pdev);
int ret;

ret = gpiochip_remove(&gpio->gp);
if (ret == 0)
kfree(gpio);

return ret;
return gpiochip_remove(&gpio->gp);
}

static struct platform_driver da9052_gpio_driver = {
Expand Down

0 comments on commit 02a5e8f

Please sign in to comment.