diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-27 10:24:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-27 10:25:27 -0500 |
commit | 2c823d14bfad16e75d16674a312a779a1485a2bd (patch) | |
tree | e6327788718c36a24b19151b4863c9e09fe30356 | |
parent | 07a38b1b4ee505a70c31eb015f1f031dcdb854ab (diff) |
ASoC: wm8753: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8753.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 21ed75de41f3..59c28dbc5fc9 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1557,7 +1557,8 @@ static int __devinit wm8753_spi_probe(struct spi_device *spi) | |||
1557 | struct wm8753_priv *wm8753; | 1557 | struct wm8753_priv *wm8753; |
1558 | int ret; | 1558 | int ret; |
1559 | 1559 | ||
1560 | wm8753 = kzalloc(sizeof(struct wm8753_priv), GFP_KERNEL); | 1560 | wm8753 = devm_kzalloc(&spi->dev, sizeof(struct wm8753_priv), |
1561 | GFP_KERNEL); | ||
1561 | if (wm8753 == NULL) | 1562 | if (wm8753 == NULL) |
1562 | return -ENOMEM; | 1563 | return -ENOMEM; |
1563 | 1564 | ||
@@ -1580,7 +1581,6 @@ static int __devinit wm8753_spi_probe(struct spi_device *spi) | |||
1580 | err_regmap: | 1581 | err_regmap: |
1581 | regmap_exit(wm8753->regmap); | 1582 | regmap_exit(wm8753->regmap); |
1582 | err: | 1583 | err: |
1583 | kfree(wm8753); | ||
1584 | return ret; | 1584 | return ret; |
1585 | } | 1585 | } |
1586 | 1586 | ||
@@ -1612,7 +1612,8 @@ static __devinit int wm8753_i2c_probe(struct i2c_client *i2c, | |||
1612 | struct wm8753_priv *wm8753; | 1612 | struct wm8753_priv *wm8753; |
1613 | int ret; | 1613 | int ret; |
1614 | 1614 | ||
1615 | wm8753 = kzalloc(sizeof(struct wm8753_priv), GFP_KERNEL); | 1615 | wm8753 = devm_kzalloc(&i2c->dev, sizeof(struct wm8753_priv), |
1616 | GFP_KERNEL); | ||
1616 | if (wm8753 == NULL) | 1617 | if (wm8753 == NULL) |
1617 | return -ENOMEM; | 1618 | return -ENOMEM; |
1618 | 1619 | ||
@@ -1632,10 +1633,10 @@ static __devinit int wm8753_i2c_probe(struct i2c_client *i2c, | |||
1632 | dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); | 1633 | dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); |
1633 | goto err_regmap; | 1634 | goto err_regmap; |
1634 | } | 1635 | } |
1636 | |||
1635 | err_regmap: | 1637 | err_regmap: |
1636 | regmap_exit(wm8753->regmap); | 1638 | regmap_exit(wm8753->regmap); |
1637 | err: | 1639 | err: |
1638 | kfree(wm8753); | ||
1639 | return ret; | 1640 | return ret; |
1640 | } | 1641 | } |
1641 | 1642 | ||
@@ -1645,7 +1646,6 @@ static __devexit int wm8753_i2c_remove(struct i2c_client *client) | |||
1645 | 1646 | ||
1646 | snd_soc_unregister_codec(&client->dev); | 1647 | snd_soc_unregister_codec(&client->dev); |
1647 | regmap_exit(wm8753->regmap); | 1648 | regmap_exit(wm8753->regmap); |
1648 | kfree(wm8753); | ||
1649 | return 0; | 1649 | return 0; |
1650 | } | 1650 | } |
1651 | 1651 | ||