diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-11-16 20:13:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-11-22 11:27:59 -0500 |
commit | 60bc6173e049ef0f2dd5e7341659afada62f6b1d (patch) | |
tree | fdbfe1abfa7f9022b87ba54298019d289498c3e2 | |
parent | 2f3d1b659344ad28bd559dcb2176e9ae84a2b044 (diff) |
ASoC: wm8580: Remove #if IS_ENABLED(CONFIG_I2C)
wm8580 driver doesn't work without CONFIG_I2C anyway.
Let's remove #if IS_ENABLED(CONFIG_I2C), and use module_i2c_driver().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/wm8580.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index da93b703ed49..910801dddd64 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -1000,7 +1000,6 @@ static const struct of_device_id wm8580_of_match[] = { | |||
1000 | }; | 1000 | }; |
1001 | MODULE_DEVICE_TABLE(of, wm8580_of_match); | 1001 | MODULE_DEVICE_TABLE(of, wm8580_of_match); |
1002 | 1002 | ||
1003 | #if IS_ENABLED(CONFIG_I2C) | ||
1004 | static int wm8580_i2c_probe(struct i2c_client *i2c, | 1003 | static int wm8580_i2c_probe(struct i2c_client *i2c, |
1005 | const struct i2c_device_id *id) | 1004 | const struct i2c_device_id *id) |
1006 | { | 1005 | { |
@@ -1066,30 +1065,8 @@ static struct i2c_driver wm8580_i2c_driver = { | |||
1066 | .remove = wm8580_i2c_remove, | 1065 | .remove = wm8580_i2c_remove, |
1067 | .id_table = wm8580_i2c_id, | 1066 | .id_table = wm8580_i2c_id, |
1068 | }; | 1067 | }; |
1069 | #endif | ||
1070 | 1068 | ||
1071 | static int __init wm8580_modinit(void) | 1069 | module_i2c_driver(wm8580_i2c_driver); |
1072 | { | ||
1073 | int ret = 0; | ||
1074 | |||
1075 | #if IS_ENABLED(CONFIG_I2C) | ||
1076 | ret = i2c_add_driver(&wm8580_i2c_driver); | ||
1077 | if (ret != 0) { | ||
1078 | pr_err("Failed to register WM8580 I2C driver: %d\n", ret); | ||
1079 | } | ||
1080 | #endif | ||
1081 | |||
1082 | return ret; | ||
1083 | } | ||
1084 | module_init(wm8580_modinit); | ||
1085 | |||
1086 | static void __exit wm8580_exit(void) | ||
1087 | { | ||
1088 | #if IS_ENABLED(CONFIG_I2C) | ||
1089 | i2c_del_driver(&wm8580_i2c_driver); | ||
1090 | #endif | ||
1091 | } | ||
1092 | module_exit(wm8580_exit); | ||
1093 | 1070 | ||
1094 | MODULE_DESCRIPTION("ASoC WM8580 driver"); | 1071 | MODULE_DESCRIPTION("ASoC WM8580 driver"); |
1095 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | 1072 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |