Skip to content

Commit 60bc617

Browse files
morimotobroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 2f3d1b6 commit 60bc617

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

sound/soc/codecs/wm8580.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,6 @@ static const struct of_device_id wm8580_of_match[] = {
10001000
};
10011001
MODULE_DEVICE_TABLE(of, wm8580_of_match);
10021002

1003-
#if IS_ENABLED(CONFIG_I2C)
10041003
static int wm8580_i2c_probe(struct i2c_client *i2c,
10051004
const struct i2c_device_id *id)
10061005
{
@@ -1066,30 +1065,8 @@ static struct i2c_driver wm8580_i2c_driver = {
10661065
.remove = wm8580_i2c_remove,
10671066
.id_table = wm8580_i2c_id,
10681067
};
1069-
#endif
10701068

1071-
static int __init wm8580_modinit(void)
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);
1069+
module_i2c_driver(wm8580_i2c_driver);
10931070

10941071
MODULE_DESCRIPTION("ASoC WM8580 driver");
10951072
MODULE_AUTHOR("Mark Brown <[email protected]>");

0 commit comments

Comments
 (0)