Commit ef149770 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: uda1380: Return proper error in uda1380_modinit failure path

Return proper error for uda1380_modinit if i2c_add_driver() fails.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 36d54dc0
...@@ -863,13 +863,13 @@ static struct i2c_driver uda1380_i2c_driver = { ...@@ -863,13 +863,13 @@ static struct i2c_driver uda1380_i2c_driver = {
static int __init uda1380_modinit(void) static int __init uda1380_modinit(void)
{ {
int ret; int ret = 0;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
ret = i2c_add_driver(&uda1380_i2c_driver); ret = i2c_add_driver(&uda1380_i2c_driver);
if (ret != 0) if (ret != 0)
pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); pr_err("Failed to register UDA1380 I2C driver: %d\n", ret);
#endif #endif
return 0; return ret;
} }
module_init(uda1380_modinit); module_init(uda1380_modinit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment