diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-11-16 09:13:38 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-17 20:15:39 (GMT) |
commit | 6e5af184f810f6150e07339bd23a09c498739c82 (patch) | |
tree | 0e0cbc3375b725df5a432f42e9bdca94402dc5d5 /drivers/staging/iio/magnetometer | |
parent | 3acbb0142d48713a8f65cde678a54f419801c189 (diff) | |
download | linux-6e5af184f810f6150e07339bd23a09c498739c82.tar.xz |
staging:iio: Use module_i2c_driver to register I2C drivers
Use the newly introduced module_i2c_driver macro for registering I2C drivers.
This allows us to remove a few lines of boilerplate code.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/magnetometer')
-rw-r--r-- | drivers/staging/iio/magnetometer/ak8975.c | 14 | ||||
-rw-r--r-- | drivers/staging/iio/magnetometer/hmc5843.c | 14 |
2 files changed, 2 insertions, 26 deletions
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index 8b01712..db31d6d 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c @@ -572,19 +572,7 @@ static struct i2c_driver ak8975_driver = { .remove = __devexit_p(ak8975_remove), .id_table = ak8975_id, }; - -static int __init ak8975_init(void) -{ - return i2c_add_driver(&ak8975_driver); -} - -static void __exit ak8975_exit(void) -{ - i2c_del_driver(&ak8975_driver); -} - -module_init(ak8975_init); -module_exit(ak8975_exit); +module_i2c_driver(ak8975_driver); MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); MODULE_DESCRIPTION("AK8975 magnetometer driver"); diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index fc9ee97..7bb1bc6 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c @@ -618,20 +618,8 @@ static struct i2c_driver hmc5843_driver = { .suspend = hmc5843_suspend, .resume = hmc5843_resume, }; - -static int __init hmc5843_init(void) -{ - return i2c_add_driver(&hmc5843_driver); -} - -static void __exit hmc5843_exit(void) -{ - i2c_del_driver(&hmc5843_driver); -} +module_i2c_driver(hmc5843_driver); MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com"); MODULE_DESCRIPTION("HMC5843 driver"); MODULE_LICENSE("GPL"); - -module_init(hmc5843_init); -module_exit(hmc5843_exit); |