alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>
Subject: [PATCH] ASoC: Return proper error if i2c_add_driver fails
Date: Tue, 10 Jan 2012 16:54:50 +0800	[thread overview]
Message-ID: <1326185690.28549.1.camel@phoenix> (raw)

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/wm8523.c |    4 ++--
 sound/soc/codecs/wm8711.c |    4 ++--
 sound/soc/codecs/wm8737.c |    4 ++--
 sound/soc/codecs/wm8962.c |    4 ++--
 sound/soc/codecs/wm8991.c |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c
index 7fea2c3..84b2ddc 100644
--- a/sound/soc/codecs/wm8523.c
+++ b/sound/soc/codecs/wm8523.c
@@ -559,7 +559,7 @@ static struct i2c_driver wm8523_i2c_driver = {
 
 static int __init wm8523_modinit(void)
 {
-	int ret;
+	int ret = 0;
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
 	ret = i2c_add_driver(&wm8523_i2c_driver);
 	if (ret != 0) {
@@ -567,7 +567,7 @@ static int __init wm8523_modinit(void)
 		       ret);
 	}
 #endif
-	return 0;
+	return ret;
 }
 module_init(wm8523_modinit);
 
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 0b76d1d..727fb57 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -494,7 +494,7 @@ static struct i2c_driver wm8711_i2c_driver = {
 
 static int __init wm8711_modinit(void)
 {
-	int ret;
+	int ret = 0;
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
 	ret = i2c_add_driver(&wm8711_i2c_driver);
 	if (ret != 0) {
@@ -509,7 +509,7 @@ static int __init wm8711_modinit(void)
 		       ret);
 	}
 #endif
-	return 0;
+	return ret;
 }
 module_init(wm8711_modinit);
 
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index ff95e62c..9a19a44 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -728,7 +728,7 @@ static struct spi_driver wm8737_spi_driver = {
 
 static int __init wm8737_modinit(void)
 {
-	int ret;
+	int ret = 0;
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
 	ret = i2c_add_driver(&wm8737_i2c_driver);
 	if (ret != 0) {
@@ -743,7 +743,7 @@ static int __init wm8737_modinit(void)
 		       ret);
 	}
 #endif
-	return 0;
+	return ret;
 }
 module_init(wm8737_modinit);
 
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 296de4e..30bc788 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -4288,7 +4288,7 @@ static struct i2c_driver wm8962_i2c_driver = {
 
 static int __init wm8962_modinit(void)
 {
-	int ret;
+	int ret = 0;
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
 	ret = i2c_add_driver(&wm8962_i2c_driver);
 	if (ret != 0) {
@@ -4296,7 +4296,7 @@ static int __init wm8962_modinit(void)
 		       ret);
 	}
 #endif
-	return 0;
+	return ret;
 }
 module_init(wm8962_modinit);
 
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 7ee40da..d877487 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -1402,13 +1402,13 @@ static struct i2c_driver wm8991_i2c_driver = {
 
 static int __init wm8991_modinit(void)
 {
-	int ret;
+	int ret = 0;
 	ret = i2c_add_driver(&wm8991_i2c_driver);
 	if (ret != 0) {
 		printk(KERN_ERR "Failed to register WM8991 I2C driver: %d\n",
 		       ret);
 	}
-	return 0;
+	return ret;
 }
 module_init(wm8991_modinit);
 
-- 
1.7.5.4

             reply	other threads:[~2012-01-10  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10  8:54 Axel Lin [this message]
2012-01-10 18:53 ` [PATCH] ASoC: Return proper error if i2c_add_driver fails Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326185690.28549.1.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).