summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8804.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-10-09 21:31:31 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-10-11 13:38:21 +0200
commitfe3e2e7ff2da41bd7a985c4c206e05a95ebe7a6b (patch)
tree5b38eeb914e7df3a7e331b388d9c2669829172ea /sound/soc/codecs/wm8804.c
parentASoC: Compress WM8962 register access map (diff)
downloadlinux-fe3e2e7ff2da41bd7a985c4c206e05a95ebe7a6b.tar.xz
linux-fe3e2e7ff2da41bd7a985c4c206e05a95ebe7a6b.zip
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/codecs/wm8804.c')
-rw-r--r--sound/soc/codecs/wm8804.c8
1 files changed, 4 insertions, 4 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)
int ret;
wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL);
- if (IS_ERR(wm8804))
- return PTR_ERR(wm8804);
+ if (!wm8804)
+ return -ENOMEM;
wm8804->control_type = SND_SOC_SPI;
spi_set_drvdata(spi, wm8804);
@@ -758,8 +758,8 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c,
int ret;
wm8804 = kzalloc(sizeof *wm8804, GFP_KERNEL);
- if (IS_ERR(wm8804))
- return PTR_ERR(wm8804);
+ if (!wm8804)
+ return -ENOMEM;
wm8804->control_type = SND_SOC_I2C;
i2c_set_clientdata(i2c, wm8804);