Skip to content

Commit

Permalink
ASoC: ak4642: Convert to module_i2c_driver()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Dec 2, 2013
1 parent 4574cd9 commit 2f54d2a
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions sound/soc/codecs/ak4642.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ static const struct regmap_config ak4648_regmap = {
.num_reg_defaults = ARRAY_SIZE(ak4648_reg),
};

#if IS_ENABLED(CONFIG_I2C)
static struct of_device_id ak4642_of_match[];
static int ak4642_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
Expand Down Expand Up @@ -577,27 +576,8 @@ static struct i2c_driver ak4642_i2c_driver = {
.remove = ak4642_i2c_remove,
.id_table = ak4642_i2c_id,
};
#endif

static int __init ak4642_modinit(void)
{
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_i2c_driver(ak4642_i2c_driver);

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

0 comments on commit 2f54d2a

Please sign in to comment.