aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-08-26 10:29:11 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-29 04:06:09 -0400
commitacdfc9e305b8320c5dee714a08be022441b58c44 (patch)
tree60fc9d1ce667a571daec975cf8e989e17bdfb634 /sound/soc
parent9b6e12e45883451d24c99f5dc3ebad5f910c01d5 (diff)
ALSA: ASoC: WM8903 I2C cleanups
Fix a few issues identified by Jean Delvare: - Add missing newline to error display. - Return an error when we fail to locate the I2C adaptor. - Remove the static wm8903_i2c_device Jean suggested, it's redundant. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8903.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 73dfd5b8f148..a3f54ec4226e 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1706,8 +1706,6 @@ static struct i2c_driver wm8903_i2c_driver = {
1706 .id_table = wm8903_i2c_id, 1706 .id_table = wm8903_i2c_id,
1707}; 1707};
1708 1708
1709static struct i2c_client *wm8903_i2c_device;
1710
1711static int wm8903_probe(struct platform_device *pdev) 1709static int wm8903_probe(struct platform_device *pdev)
1712{ 1710{
1713 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1711 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
@@ -1716,6 +1714,7 @@ static int wm8903_probe(struct platform_device *pdev)
1716 struct wm8903_priv *wm8903; 1714 struct wm8903_priv *wm8903;
1717 struct i2c_board_info board_info; 1715 struct i2c_board_info board_info;
1718 struct i2c_adapter *adapter; 1716 struct i2c_adapter *adapter;
1717 struct i2c_client *i2c_client;
1719 int ret = 0; 1718 int ret = 0;
1720 1719
1721 setup = socdev->codec_data; 1720 setup = socdev->codec_data;
@@ -1746,7 +1745,7 @@ static int wm8903_probe(struct platform_device *pdev)
1746 codec->hw_write = (hw_write_t)i2c_master_send; 1745 codec->hw_write = (hw_write_t)i2c_master_send;
1747 ret = i2c_add_driver(&wm8903_i2c_driver); 1746 ret = i2c_add_driver(&wm8903_i2c_driver);
1748 if (ret != 0) { 1747 if (ret != 0) {
1749 dev_err(&pdev->dev, "can't add i2c driver"); 1748 dev_err(&pdev->dev, "can't add i2c driver\n");
1750 goto err_priv; 1749 goto err_priv;
1751 } else { 1750 } else {
1752 memset(&board_info, 0, sizeof(board_info)); 1751 memset(&board_info, 0, sizeof(board_info));
@@ -1757,12 +1756,13 @@ static int wm8903_probe(struct platform_device *pdev)
1757 if (!adapter) { 1756 if (!adapter) {
1758 dev_err(&pdev->dev, "Can't get I2C bus %d\n", 1757 dev_err(&pdev->dev, "Can't get I2C bus %d\n",
1759 setup->i2c_bus); 1758 setup->i2c_bus);
1759 ret = -ENODEV;
1760 goto err_adapter; 1760 goto err_adapter;
1761 } 1761 }
1762 1762
1763 wm8903_i2c_device = i2c_new_device(adapter, &board_info); 1763 i2c_client = i2c_new_device(adapter, &board_info);
1764 i2c_put_adapter(adapter); 1764 i2c_put_adapter(adapter);
1765 if (wm8903_i2c_device == NULL) { 1765 if (i2c_client == NULL) {
1766 dev_err(&pdev->dev, 1766 dev_err(&pdev->dev,
1767 "I2C driver registration failed\n"); 1767 "I2C driver registration failed\n");
1768 ret = -ENODEV; 1768 ret = -ENODEV;
@@ -1792,7 +1792,7 @@ static int wm8903_remove(struct platform_device *pdev)
1792 1792
1793 snd_soc_free_pcms(socdev); 1793 snd_soc_free_pcms(socdev);
1794 snd_soc_dapm_free(socdev); 1794 snd_soc_dapm_free(socdev);
1795 i2c_unregister_device(wm8903_i2c_device); 1795 i2c_unregister_device(socdev->codec->control_data);
1796 i2c_del_driver(&wm8903_i2c_driver); 1796 i2c_del_driver(&wm8903_i2c_driver);
1797 kfree(codec->private_data); 1797 kfree(codec->private_data);
1798 kfree(codec); 1798 kfree(codec);