Skip to content

Commit 2f54d2a

Browse files
committed
ASoC: ak4642: Convert to module_i2c_driver()
The device does not support anything other than I2C (at least with the current driver) so save code. Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 4574cd9 commit 2f54d2a

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

‎sound/soc/codecs/ak4642.c‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ static const struct regmap_config ak4648_regmap = {
513513
.num_reg_defaults = ARRAY_SIZE(ak4648_reg),
514514
};
515515

516-
#if IS_ENABLED(CONFIG_I2C)
517516
static struct of_device_id ak4642_of_match[];
518517
static int ak4642_i2c_probe(struct i2c_client *i2c,
519518
const struct i2c_device_id *id)
@@ -577,27 +576,8 @@ static struct i2c_driver ak4642_i2c_driver = {
577576
.remove = ak4642_i2c_remove,
578577
.id_table = ak4642_i2c_id,
579578
};
580-
#endif
581579

582-
static int __init ak4642_modinit(void)
583-
{
584-
int ret = 0;
585-
#if IS_ENABLED(CONFIG_I2C)
586-
ret = i2c_add_driver(&ak4642_i2c_driver);
587-
#endif
588-
return ret;
589-
590-
}
591-
module_init(ak4642_modinit);
592-
593-
static void __exit ak4642_exit(void)
594-
{
595-
#if IS_ENABLED(CONFIG_I2C)
596-
i2c_del_driver(&ak4642_i2c_driver);
597-
#endif
598-
599-
}
600-
module_exit(ak4642_exit);
580+
module_i2c_driver(ak4642_i2c_driver);
601581

602582
MODULE_DESCRIPTION("Soc AK4642 driver");
603583
MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");

0 commit comments

Comments
 (0)