Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332102
b: refs/heads/master
c: 040242c
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Sep 13, 2012
1 parent 63e2ca2 commit 4f740ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 41 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: ab7af5c8d456103ea57c7e9e6f5b03162965e665
refs/heads/master: 040242ccfcd4ae878267b521d16539e7b3000527
50 changes: 10 additions & 40 deletions trunk/sound/soc/codecs/ad193x.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,40 +381,25 @@ static const struct regmap_config ad193x_spi_regmap_config = {
static int __devinit ad193x_spi_probe(struct spi_device *spi)
{
struct ad193x_priv *ad193x;
int ret;

ad193x = devm_kzalloc(&spi->dev, sizeof(struct ad193x_priv),
GFP_KERNEL);
if (ad193x == NULL)
return -ENOMEM;

ad193x->regmap = regmap_init_spi(spi, &ad193x_spi_regmap_config);
if (IS_ERR(ad193x->regmap)) {
ret = PTR_ERR(ad193x->regmap);
goto err_out;
}
ad193x->regmap = devm_regmap_init_spi(spi, &ad193x_spi_regmap_config);
if (IS_ERR(ad193x->regmap))
return PTR_ERR(ad193x->regmap);

spi_set_drvdata(spi, ad193x);

ret = snd_soc_register_codec(&spi->dev,
&soc_codec_dev_ad193x, &ad193x_dai, 1);
if (ret < 0)
goto err_regmap_exit;

return 0;

err_regmap_exit:
regmap_exit(ad193x->regmap);
err_out:
return ret;
return snd_soc_register_codec(&spi->dev, &soc_codec_dev_ad193x,
&ad193x_dai, 1);
}

static int __devexit ad193x_spi_remove(struct spi_device *spi)
{
struct ad193x_priv *ad193x = spi_get_drvdata(spi);

snd_soc_unregister_codec(&spi->dev);
regmap_exit(ad193x->regmap);
return 0;
}

Expand Down Expand Up @@ -449,40 +434,25 @@ static int __devinit ad193x_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct ad193x_priv *ad193x;
int ret;

ad193x = devm_kzalloc(&client->dev, sizeof(struct ad193x_priv),
GFP_KERNEL);
if (ad193x == NULL)
return -ENOMEM;

ad193x->regmap = regmap_init_i2c(client, &ad193x_i2c_regmap_config);
if (IS_ERR(ad193x->regmap)) {
ret = PTR_ERR(ad193x->regmap);
goto err_out;
}
ad193x->regmap = devm_regmap_init_i2c(client, &ad193x_i2c_regmap_config);
if (IS_ERR(ad193x->regmap))
return PTR_ERR(ad193x->regmap);

i2c_set_clientdata(client, ad193x);

ret = snd_soc_register_codec(&client->dev,
&soc_codec_dev_ad193x, &ad193x_dai, 1);
if (ret < 0)
goto err_regmap_exit;

return 0;

err_regmap_exit:
regmap_exit(ad193x->regmap);
err_out:
return ret;
return snd_soc_register_codec(&client->dev, &soc_codec_dev_ad193x,
&ad193x_dai, 1);
}

static int __devexit ad193x_i2c_remove(struct i2c_client *client)
{
struct ad193x_priv *ad193x = i2c_get_clientdata(client);

snd_soc_unregister_codec(&client->dev);
regmap_exit(ad193x->regmap);
return 0;
}

Expand Down

0 comments on commit 4f740ea

Please sign in to comment.