aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-10-09 15:31:31 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-10-11 07:38:21 -0400
commitfe3e2e7ff2da41bd7a985c4c206e05a95ebe7a6b (patch)
tree5b38eeb914e7df3a7e331b388d9c2669829172ea /sound/soc
parentc969f19f8fd17e600a16fe91aab66d86936cce0a (diff)
ASoC: checking kzalloc() for IS_ERR() instead of NULL
There is a typo here that got copy and pasted to several probe functions. kzalloc() returns NULL on allocation failures and not an ERR_PTR. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8804.c8
-rw-r--r--sound/soc/codecs/wm8985.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index 642b07ceddfa..4599e8e95aa2 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -720,8 +720,8 @@ static int __devinit wm8804_spi_probe(struct spi_device *spi)
720 int ret; 720 int ret;
721 721
722 wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL); 722 wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL);
723 if (IS_ERR(wm8804)) 723 if (!wm8804)
724 return PTR_ERR(wm8804); 724 return -ENOMEM;
725 725
726 wm8804->control_type = SND_SOC_SPI; 726 wm8804->control_type = SND_SOC_SPI;
727 spi_set_drvdata(spi, wm8804); 727 spi_set_drvdata(spi, wm8804);
@@ -758,8 +758,8 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c,
758 int ret; 758 int ret;
759 759
760 wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL); 760 wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL);
761 if (IS_ERR(wm8804)) 761 if (!wm8804)
762 return PTR_ERR(wm8804); 762 return -ENOMEM;
763 763
764 wm8804->control_type = SND_SOC_I2C; 764 wm8804->control_type = SND_SOC_I2C;
765 i2c_set_clientdata(i2c, wm8804); 765 i2c_set_clientdata(i2c, wm8804);
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c
index ae9020a2a195..fd2e7cca1228 100644
--- a/sound/soc/codecs/wm8985.c
+++ b/sound/soc/codecs/wm8985.c
@@ -1079,8 +1079,8 @@ static int __devinit wm8985_spi_probe(struct spi_device *spi)
1079 int ret; 1079 int ret;
1080 1080
1081 wm8985 = kzalloc(sizeof *wm8985, GFP_KERNEL); 1081 wm8985 = kzalloc(sizeof *wm8985, GFP_KERNEL);
1082 if (IS_ERR(wm8985)) 1082 if (!wm8985)
1083 return PTR_ERR(wm8985); 1083 return -ENOMEM;
1084 1084
1085 wm8985->control_type = SND_SOC_SPI; 1085 wm8985->control_type = SND_SOC_SPI;
1086 spi_set_drvdata(spi, wm8985); 1086 spi_set_drvdata(spi, wm8985);
@@ -1117,8 +1117,8 @@ static __devinit int wm8985_i2c_probe(struct i2c_client *i2c,
1117 int ret; 1117 int ret;
1118 1118
1119 wm8985 = kzalloc(sizeof *wm8985, GFP_KERNEL); 1119 wm8985 = kzalloc(sizeof *wm8985, GFP_KERNEL);
1120 if (IS_ERR(wm8985)) 1120 if (!wm8985)
1121 return PTR_ERR(wm8985); 1121 return -ENOMEM;
1122 1122
1123 wm8985->control_type = SND_SOC_I2C; 1123 wm8985->control_type = SND_SOC_I2C;
1124 i2c_set_clientdata(i2c, wm8985); 1124 i2c_set_clientdata(i2c, wm8985);