Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283791
b: refs/heads/master
c: 5fe803f
h: refs/heads/master
i:
  283789: b2e2c02
  283787: 1834ba9
  283783: 478e166
  283775: d4d3e39
v: v3
  • Loading branch information
Mark Brown committed Nov 27, 2011
1 parent f678fc4 commit ab5ab80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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: 997c2ea916edb516f23d6e1848cd1f4a10e62740
refs/heads/master: 5fe803f56ad41cf008399f71ee48280f0cf9732b
10 changes: 3 additions & 7 deletions trunk/sound/soc/codecs/wm1250-ev1.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c)
if (!pdata)
return 0;

wm1250 = kzalloc(sizeof(*wm1250), GFP_KERNEL);
wm1250 = devm_kzalloc(&i2c->dev, sizeof(*wm1250), GFP_KERNEL);
if (!wm1250) {
dev_err(&i2c->dev, "Unable to allocate private data\n");
ret = -ENOMEM;
Expand All @@ -134,15 +134,13 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c)
ret = gpio_request_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios));
if (ret != 0) {
dev_err(&i2c->dev, "Failed to get GPIOs: %d\n", ret);
goto err_alloc;
goto err;
}

dev_set_drvdata(&i2c->dev, wm1250);

return ret;

err_alloc:
kfree(wm1250);
err:
return ret;
}
Expand All @@ -151,10 +149,8 @@ static void wm1250_ev1_free(struct i2c_client *i2c)
{
struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev);

if (wm1250) {
if (wm1250)
gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios));
kfree(wm1250);
}
}

static int __devinit wm1250_ev1_probe(struct i2c_client *i2c,
Expand Down

0 comments on commit ab5ab80

Please sign in to comment.