]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - sound/soc/codecs/wm8804.c
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
[can-eth-gw-linux.git] / sound / soc / codecs / wm8804.c
index c088020172ab66e25bbc8e0f30f554b77debb202..d321a875b029dc693fb2b7483dd73ceea1ce4ee8 100644 (file)
@@ -702,7 +702,7 @@ static struct regmap_config wm8804_regmap_config = {
 };
 
 #if defined(CONFIG_SPI_MASTER)
-static int __devinit wm8804_spi_probe(struct spi_device *spi)
+static int wm8804_spi_probe(struct spi_device *spi)
 {
        struct wm8804_priv *wm8804;
        int ret;
@@ -711,7 +711,7 @@ static int __devinit wm8804_spi_probe(struct spi_device *spi)
        if (!wm8804)
                return -ENOMEM;
 
-       wm8804->regmap = regmap_init_spi(spi, &wm8804_regmap_config);
+       wm8804->regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config);
        if (IS_ERR(wm8804->regmap)) {
                ret = PTR_ERR(wm8804->regmap);
                return ret;
@@ -725,11 +725,9 @@ static int __devinit wm8804_spi_probe(struct spi_device *spi)
        return ret;
 }
 
-static int __devexit wm8804_spi_remove(struct spi_device *spi)
+static int wm8804_spi_remove(struct spi_device *spi)
 {
-       struct wm8804_priv *wm8804 = spi_get_drvdata(spi);
        snd_soc_unregister_codec(&spi->dev);
-       regmap_exit(wm8804->regmap);
        return 0;
 }
 
@@ -740,13 +738,13 @@ static struct spi_driver wm8804_spi_driver = {
                .of_match_table = wm8804_of_match,
        },
        .probe = wm8804_spi_probe,
-       .remove = __devexit_p(wm8804_spi_remove)
+       .remove = wm8804_spi_remove
 };
 #endif
 
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-static __devinit int wm8804_i2c_probe(struct i2c_client *i2c,
-                                     const struct i2c_device_id *id)
+static int wm8804_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
 {
        struct wm8804_priv *wm8804;
        int ret;
@@ -755,7 +753,7 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c,
        if (!wm8804)
                return -ENOMEM;
 
-       wm8804->regmap = regmap_init_i2c(i2c, &wm8804_regmap_config);
+       wm8804->regmap = devm_regmap_init_i2c(i2c, &wm8804_regmap_config);
        if (IS_ERR(wm8804->regmap)) {
                ret = PTR_ERR(wm8804->regmap);
                return ret;
@@ -765,23 +763,12 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c,
 
        ret = snd_soc_register_codec(&i2c->dev,
                                     &soc_codec_dev_wm8804, &wm8804_dai, 1);
-       if (ret != 0)
-               goto err;
-
-       return 0;
-
-err:
-       regmap_exit(wm8804->regmap);
        return ret;
 }
 
-static __devexit int wm8804_i2c_remove(struct i2c_client *i2c)
+static int wm8804_i2c_remove(struct i2c_client *i2c)
 {
-       struct wm8804_priv *wm8804 = i2c_get_clientdata(i2c);
-
        snd_soc_unregister_codec(&i2c->dev);
-       regmap_exit(wm8804->regmap);
-
        return 0;
 }
 
@@ -798,7 +785,7 @@ static struct i2c_driver wm8804_i2c_driver = {
                .of_match_table = wm8804_of_match,
        },
        .probe = wm8804_i2c_probe,
-       .remove = __devexit_p(wm8804_i2c_remove),
+       .remove = wm8804_i2c_remove,
        .id_table = wm8804_i2c_id
 };
 #endif