Commit 2f54d2a1 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@linaro.org>
parent 4574cd94
...@@ -513,7 +513,6 @@ static const struct regmap_config ak4648_regmap = { ...@@ -513,7 +513,6 @@ static const struct regmap_config ak4648_regmap = {
.num_reg_defaults = ARRAY_SIZE(ak4648_reg), .num_reg_defaults = ARRAY_SIZE(ak4648_reg),
}; };
#if IS_ENABLED(CONFIG_I2C)
static struct of_device_id ak4642_of_match[]; static struct of_device_id ak4642_of_match[];
static int ak4642_i2c_probe(struct i2c_client *i2c, static int ak4642_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
...@@ -577,27 +576,8 @@ static struct i2c_driver ak4642_i2c_driver = { ...@@ -577,27 +576,8 @@ static struct i2c_driver ak4642_i2c_driver = {
.remove = ak4642_i2c_remove, .remove = ak4642_i2c_remove,
.id_table = ak4642_i2c_id, .id_table = ak4642_i2c_id,
}; };
#endif
static int __init ak4642_modinit(void) module_i2c_driver(ak4642_i2c_driver);
{
int ret = 0;
#if IS_ENABLED(CONFIG_I2C)
ret = i2c_add_driver(&ak4642_i2c_driver);
#endif
return ret;
}
module_init(ak4642_modinit);
static void __exit ak4642_exit(void)
{
#if IS_ENABLED(CONFIG_I2C)
i2c_del_driver(&ak4642_i2c_driver);
#endif
}
module_exit(ak4642_exit);
MODULE_DESCRIPTION("Soc AK4642 driver"); MODULE_DESCRIPTION("Soc AK4642 driver");
MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>"); MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
......
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