Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328451
b: refs/heads/master
c: 5b42543
h: refs/heads/master
i:
  328449: 094b3bf
  328447: b003e5e
v: v3
  • Loading branch information
Axel Lin authored and Linus Walleij committed Sep 4, 2012
1 parent 3ac9e93 commit 5f509ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 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: 718bc6e33f33914690ba1b757de2327da7522a87
refs/heads/master: 5b4254386bf9a96dfcef9ec8e099bd06fe3e6896
19 changes: 5 additions & 14 deletions trunk/drivers/gpio/gpio-wm8350.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ static int __devinit wm8350_gpio_probe(struct platform_device *pdev)
struct wm8350_gpio_data *wm8350_gpio;
int ret;

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

Expand All @@ -131,30 +132,20 @@ static int __devinit wm8350_gpio_probe(struct platform_device *pdev)

ret = gpiochip_add(&wm8350_gpio->gpio_chip);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
ret);
goto err;
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
}

platform_set_drvdata(pdev, wm8350_gpio);

return ret;

err:
kfree(wm8350_gpio);
return ret;
}

static int __devexit wm8350_gpio_remove(struct platform_device *pdev)
{
struct wm8350_gpio_data *wm8350_gpio = platform_get_drvdata(pdev);
int ret;

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

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

static struct platform_driver wm8350_gpio_driver = {
Expand Down

0 comments on commit 5f509ff

Please sign in to comment.