From b00e126ffea89b687a83093546058b07aa054b4c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 22 Jan 2012 15:33:49 +0800 Subject: MISC: convert drivers/misc/* to use module_platform_driver() This patch converts the drivers in drivers/misc/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin Acked-by: Ira W. Snyder Cc: Pavan Savoy Cc: Donggeun Kim Acked-By: Pratyush Anand Acked-by: Arnd Bergmann Acked-by: Pratyush Anand Signed-off-by: Greg Kroah-Hartman --- drivers/misc/carma/carma-fpga.c | 17 +---------------- drivers/misc/max8997-muic.c | 12 +----------- drivers/misc/spear13xx_pcie_gadget.c | 12 +----------- drivers/misc/ti-st/st_kim.c | 13 +------------ 4 files changed, 4 insertions(+), 50 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/carma/carma-fpga.c b/drivers/misc/carma/carma-fpga.c index 14e974b2a781..366bc156e34d 100644 --- a/drivers/misc/carma/carma-fpga.c +++ b/drivers/misc/carma/carma-fpga.c @@ -1410,23 +1410,8 @@ static struct platform_driver data_of_driver = { }, }; -/* - * Module Init / Exit - */ - -static int __init data_init(void) -{ - return platform_driver_register(&data_of_driver); -} - -static void __exit data_exit(void) -{ - platform_driver_unregister(&data_of_driver); -} +module_platform_driver(data_of_driver); MODULE_AUTHOR("Ira W. Snyder "); MODULE_DESCRIPTION("CARMA DATA-FPGA Access Driver"); MODULE_LICENSE("GPL"); - -module_init(data_init); -module_exit(data_exit); diff --git a/drivers/misc/max8997-muic.c b/drivers/misc/max8997-muic.c index d74ef41aabd5..19591eaa492a 100644 --- a/drivers/misc/max8997-muic.c +++ b/drivers/misc/max8997-muic.c @@ -488,17 +488,7 @@ static struct platform_driver max8997_muic_driver = { .remove = __devexit_p(max8997_muic_remove), }; -static int __init max8997_muic_init(void) -{ - return platform_driver_register(&max8997_muic_driver); -} -module_init(max8997_muic_init); - -static void __exit max8997_muic_exit(void) -{ - platform_driver_unregister(&max8997_muic_driver); -} -module_exit(max8997_muic_exit); +module_platform_driver(max8997_muic_driver); MODULE_DESCRIPTION("Maxim MAX8997 MUIC driver"); MODULE_AUTHOR("Donggeun Kim "); diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c index 43d073bc1d9c..123ed98eec3e 100644 --- a/drivers/misc/spear13xx_pcie_gadget.c +++ b/drivers/misc/spear13xx_pcie_gadget.c @@ -891,17 +891,7 @@ static struct platform_driver spear_pcie_gadget_driver = { }, }; -static int __init spear_pcie_gadget_init(void) -{ - return platform_driver_register(&spear_pcie_gadget_driver); -} -module_init(spear_pcie_gadget_init); - -static void __exit spear_pcie_gadget_exit(void) -{ - platform_driver_unregister(&spear_pcie_gadget_driver); -} -module_exit(spear_pcie_gadget_exit); +module_platform_driver(spear_pcie_gadget_driver); MODULE_ALIAS("platform:pcie-gadget-spear"); MODULE_AUTHOR("Pratyush Anand"); diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index a7a861ceee2d..7c14f8fd98db 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c @@ -837,19 +837,8 @@ static struct platform_driver kim_platform_driver = { }, }; -static int __init st_kim_init(void) -{ - return platform_driver_register(&kim_platform_driver); -} - -static void __exit st_kim_deinit(void) -{ - platform_driver_unregister(&kim_platform_driver); -} - +module_platform_driver(kim_platform_driver); -module_init(st_kim_init); -module_exit(st_kim_deinit); MODULE_AUTHOR("Pavan Savoy "); MODULE_DESCRIPTION("Shared Transport Driver for TI BT/FM/GPS combo chips "); MODULE_LICENSE("GPL"); -- cgit v1.2.3 From a64fe2ed76614d37abb6966a67f4f39d10efba3c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 22 Jan 2012 15:36:45 +0800 Subject: MISC: convert drivers/misc/* to use module_i2c_driver() This patch converts the drivers in drivers/misc/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin Cc: Michael Hennerich Cc: Anantha Narayanan Cc: Hemanth V Cc: Christoph Mair Cc: Grant Likely Cc: Ben Gardner Cc: Minkyu Kang Cc: Kalhan Trisal Cc: Darrick J. Wong Cc: Daniel Mack Cc: Rodolfo Giometti Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/misc/ad525x_dpot-i2c.c | 12 +----------- drivers/misc/apds9802als.c | 12 +----------- drivers/misc/apds990x.c | 13 +------------ drivers/misc/bh1770glc.c | 13 +------------ drivers/misc/bh1780gli.c | 15 ++------------- drivers/misc/bmp085.c | 14 +------------- drivers/misc/ds1682.c | 13 +------------ drivers/misc/eeprom/eeprom.c | 14 +------------- drivers/misc/eeprom/max6875.c | 14 +------------- drivers/misc/fsa9480.c | 12 +----------- drivers/misc/hmc6352.c | 13 +------------ drivers/misc/ics932s401.c | 13 +------------ drivers/misc/isl29003.c | 14 +------------- drivers/misc/isl29020.c | 13 +------------ drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 13 +------------ drivers/misc/tsl2550.c | 13 +------------ 16 files changed, 17 insertions(+), 194 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/ad525x_dpot-i2c.c b/drivers/misc/ad525x_dpot-i2c.c index 83adab69bfd4..820826270b62 100644 --- a/drivers/misc/ad525x_dpot-i2c.c +++ b/drivers/misc/ad525x_dpot-i2c.c @@ -113,17 +113,7 @@ static struct i2c_driver ad_dpot_i2c_driver = { .id_table = ad_dpot_id, }; -static int __init ad_dpot_i2c_init(void) -{ - return i2c_add_driver(&ad_dpot_i2c_driver); -} -module_init(ad_dpot_i2c_init); - -static void __exit ad_dpot_i2c_exit(void) -{ - i2c_del_driver(&ad_dpot_i2c_driver); -} -module_exit(ad_dpot_i2c_exit); +module_i2c_driver(ad_dpot_i2c_driver); MODULE_AUTHOR("Michael Hennerich "); MODULE_DESCRIPTION("digital potentiometer I2C bus driver"); diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 81db7811cf68..0314773f6db3 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -332,17 +332,7 @@ static struct i2c_driver apds9802als_driver = { .id_table = apds9802als_id, }; -static int __init sensor_apds9802als_init(void) -{ - return i2c_add_driver(&apds9802als_driver); -} - -static void __exit sensor_apds9802als_exit(void) -{ - i2c_del_driver(&apds9802als_driver); -} -module_init(sensor_apds9802als_init); -module_exit(sensor_apds9802als_exit); +module_i2c_driver(apds9802als_driver); MODULE_AUTHOR("Anantha Narayanan "); MODULE_DESCRIPTION("DS1682 Elapsed Time Indicator driver"); MODULE_LICENSE("GPL"); - -module_init(ds1682_init); -module_exit(ds1682_exit); diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c index 45060ddc4e59..c169e07654cb 100644 --- a/drivers/misc/eeprom/eeprom.c +++ b/drivers/misc/eeprom/eeprom.c @@ -229,22 +229,10 @@ static struct i2c_driver eeprom_driver = { .address_list = normal_i2c, }; -static int __init eeprom_init(void) -{ - return i2c_add_driver(&eeprom_driver); -} - -static void __exit eeprom_exit(void) -{ - i2c_del_driver(&eeprom_driver); -} - +module_i2c_driver(eeprom_driver); MODULE_AUTHOR("Frodo Looijaard and " "Philip Edelbrock and " "Greg Kroah-Hartman "); MODULE_DESCRIPTION("I2C EEPROM driver"); MODULE_LICENSE("GPL"); - -module_init(eeprom_init); -module_exit(eeprom_exit); diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index 5653a3ce0517..e36157d5d3ab 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c @@ -208,20 +208,8 @@ static struct i2c_driver max6875_driver = { .id_table = max6875_id, }; -static int __init max6875_init(void) -{ - return i2c_add_driver(&max6875_driver); -} - -static void __exit max6875_exit(void) -{ - i2c_del_driver(&max6875_driver); -} - +module_i2c_driver(max6875_driver); MODULE_AUTHOR("Ben Gardner "); MODULE_DESCRIPTION("MAX6875 driver"); MODULE_LICENSE("GPL"); - -module_init(max6875_init); -module_exit(max6875_exit); diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c index f6586d53e1a3..483d6b738095 100644 --- a/drivers/misc/fsa9480.c +++ b/drivers/misc/fsa9480.c @@ -541,17 +541,7 @@ static struct i2c_driver fsa9480_i2c_driver = { .id_table = fsa9480_id, }; -static int __init fsa9480_init(void) -{ - return i2c_add_driver(&fsa9480_i2c_driver); -} -module_init(fsa9480_init); - -static void __exit fsa9480_exit(void) -{ - i2c_del_driver(&fsa9480_i2c_driver); -} -module_exit(fsa9480_exit); +module_i2c_driver(fsa9480_i2c_driver); MODULE_AUTHOR("Minkyu Kang "); MODULE_DESCRIPTION("FSA9480 USB Switch driver"); diff --git a/drivers/misc/hmc6352.c b/drivers/misc/hmc6352.c index ca938fc8a8d6..423cd40f1c0f 100644 --- a/drivers/misc/hmc6352.c +++ b/drivers/misc/hmc6352.c @@ -148,18 +148,7 @@ static struct i2c_driver hmc6352_driver = { .id_table = hmc6352_id, }; -static int __init sensor_hmc6352_init(void) -{ - return i2c_add_driver(&hmc6352_driver); -} - -static void __exit sensor_hmc6352_exit(void) -{ - i2c_del_driver(&hmc6352_driver); -} - -module_init(sensor_hmc6352_init); -module_exit(sensor_hmc6352_exit); +module_i2c_driver(hmc6352_driver); MODULE_AUTHOR("Kalhan Trisal "); MODULE_DESCRIPTION("ICS932S401 driver"); MODULE_LICENSE("GPL"); -module_init(ics932s401_init); -module_exit(ics932s401_exit); - /* IBM IntelliStation Z30 */ MODULE_ALIAS("dmi:bvnIBM:*:rn9228:*"); MODULE_ALIAS("dmi:bvnIBM:*:rn9232:*"); diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c index a71e245801ee..eb5de2e210d7 100644 --- a/drivers/misc/isl29003.c +++ b/drivers/misc/isl29003.c @@ -455,21 +455,9 @@ static struct i2c_driver isl29003_driver = { .id_table = isl29003_id, }; -static int __init isl29003_init(void) -{ - return i2c_add_driver(&isl29003_driver); -} - -static void __exit isl29003_exit(void) -{ - i2c_del_driver(&isl29003_driver); -} +module_i2c_driver(isl29003_driver); MODULE_AUTHOR("Daniel Mack "); MODULE_DESCRIPTION("ISL29003 ambient light sensor driver"); MODULE_LICENSE("GPL v2"); MODULE_VERSION(DRIVER_VERSION); - -module_init(isl29003_init); -module_exit(isl29003_exit); - diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c index 3d6cce663bea..0aa08c746463 100644 --- a/drivers/misc/isl29020.c +++ b/drivers/misc/isl29020.c @@ -230,18 +230,7 @@ static struct i2c_driver isl29020_driver = { .id_table = isl29020_id, }; -static int __init sensor_isl29020_init(void) -{ - return i2c_add_driver(&isl29020_driver); -} - -static void __exit sensor_isl29020_exit(void) -{ - i2c_del_driver(&isl29020_driver); -} - -module_init(sensor_isl29020_init); -module_exit(sensor_isl29020_exit); +module_i2c_driver(isl29020_driver); MODULE_AUTHOR("Kalhan Trisal "); MODULE_DESCRIPTION("Intersil isl29020 ALS Driver"); diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index c02fea029dcf..e8c0019da97a 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -256,19 +256,8 @@ static struct i2c_driver lis3lv02d_i2c_driver = { .id_table = lis3lv02d_id, }; -static int __init lis3lv02d_init(void) -{ - return i2c_add_driver(&lis3lv02d_i2c_driver); -} - -static void __exit lis3lv02d_exit(void) -{ - i2c_del_driver(&lis3lv02d_i2c_driver); -} +module_i2c_driver(lis3lv02d_i2c_driver); MODULE_AUTHOR("Nokia Corporation"); MODULE_DESCRIPTION("lis3lv02d I2C interface"); MODULE_LICENSE("GPL"); - -module_init(lis3lv02d_init); -module_exit(lis3lv02d_exit); diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 483ae5f7f68e..0beb298a17dd 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c @@ -454,20 +454,9 @@ static struct i2c_driver tsl2550_driver = { .id_table = tsl2550_id, }; -static int __init tsl2550_init(void) -{ - return i2c_add_driver(&tsl2550_driver); -} - -static void __exit tsl2550_exit(void) -{ - i2c_del_driver(&tsl2550_driver); -} +module_i2c_driver(tsl2550_driver); MODULE_AUTHOR("Rodolfo Giometti "); MODULE_DESCRIPTION("TSL2550 ambient light sensor driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRIVER_VERSION); - -module_init(tsl2550_init); -module_exit(tsl2550_exit); -- cgit v1.2.3 From a3dc3c9eb0a7bcf17604ee444c48b94e2591812d Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 22 Jan 2012 15:38:22 +0800 Subject: MISC: convert drivers/misc/* to use module_spi_driver() This patch converts the drivers in drivers/misc/* to use the module_spi_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin Cc: Michael Hennerich Cc: Anatolij Gustschin Cc: Daniel Mack Acked-by: Michael Hennerich Signed-off-by: Greg Kroah-Hartman --- drivers/misc/ad525x_dpot-spi.c | 12 +----------- drivers/misc/eeprom/at25.c | 12 +----------- drivers/misc/eeprom/eeprom_93xx46.c | 12 +----------- drivers/misc/lis3lv02d/lis3lv02d_spi.c | 13 +------------ drivers/misc/ti_dac7512.c | 13 +------------ 5 files changed, 5 insertions(+), 57 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/ad525x_dpot-spi.c b/drivers/misc/ad525x_dpot-spi.c index 822749e41fea..f62317540d00 100644 --- a/drivers/misc/ad525x_dpot-spi.c +++ b/drivers/misc/ad525x_dpot-spi.c @@ -135,17 +135,7 @@ static struct spi_driver ad_dpot_spi_driver = { .id_table = ad_dpot_spi_id, }; -static int __init ad_dpot_spi_init(void) -{ - return spi_register_driver(&ad_dpot_spi_driver); -} -module_init(ad_dpot_spi_init); - -static void __exit ad_dpot_spi_exit(void) -{ - spi_unregister_driver(&ad_dpot_spi_driver); -} -module_exit(ad_dpot_spi_exit); +module_spi_driver(ad_dpot_spi_driver); MODULE_AUTHOR("Michael Hennerich "); MODULE_DESCRIPTION("digital potentiometer SPI bus driver"); diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index c627e4174ccd..01ab3c9b4cf7 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -405,17 +405,7 @@ static struct spi_driver at25_driver = { .remove = __devexit_p(at25_remove), }; -static int __init at25_init(void) -{ - return spi_register_driver(&at25_driver); -} -module_init(at25_init); - -static void __exit at25_exit(void) -{ - spi_unregister_driver(&at25_driver); -} -module_exit(at25_exit); +module_spi_driver(at25_driver); MODULE_DESCRIPTION("Driver for most SPI EEPROMs"); MODULE_AUTHOR("David Brownell"); diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c index 0c7ebb1e19e5..ce3fe3633dd7 100644 --- a/drivers/misc/eeprom/eeprom_93xx46.c +++ b/drivers/misc/eeprom/eeprom_93xx46.c @@ -392,17 +392,7 @@ static struct spi_driver eeprom_93xx46_driver = { .remove = __devexit_p(eeprom_93xx46_remove), }; -static int __init eeprom_93xx46_init(void) -{ - return spi_register_driver(&eeprom_93xx46_driver); -} -module_init(eeprom_93xx46_init); - -static void __exit eeprom_93xx46_exit(void) -{ - spi_unregister_driver(&eeprom_93xx46_driver); -} -module_exit(eeprom_93xx46_exit); +module_spi_driver(eeprom_93xx46_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Driver for 93xx46 EEPROMs"); diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index b2c1be12d16f..80880e984b4f 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -126,18 +126,7 @@ static struct spi_driver lis302dl_spi_driver = { .remove = __devexit_p(lis302dl_spi_remove), }; -static int __init lis302dl_init(void) -{ - return spi_register_driver(&lis302dl_spi_driver); -} - -static void __exit lis302dl_exit(void) -{ - spi_unregister_driver(&lis302dl_spi_driver); -} - -module_init(lis302dl_init); -module_exit(lis302dl_exit); +module_spi_driver(lis302dl_spi_driver); MODULE_AUTHOR("Daniel Mack "); MODULE_DESCRIPTION("lis3lv02d SPI glue layer"); diff --git a/drivers/misc/ti_dac7512.c b/drivers/misc/ti_dac7512.c index d3f229a3a77e..5acbba120de0 100644 --- a/drivers/misc/ti_dac7512.c +++ b/drivers/misc/ti_dac7512.c @@ -82,20 +82,9 @@ static struct spi_driver dac7512_driver = { .remove = __devexit_p(dac7512_remove), }; -static int __init dac7512_init(void) -{ - return spi_register_driver(&dac7512_driver); -} - -static void __exit dac7512_exit(void) -{ - spi_unregister_driver(&dac7512_driver); -} +module_spi_driver(dac7512_driver); MODULE_AUTHOR("Daniel Mack "); MODULE_DESCRIPTION("DAC7512 16-bit DAC"); MODULE_LICENSE("GPL v2"); MODULE_VERSION(DRIVER_VERSION); - -module_init(dac7512_init); -module_exit(dac7512_exit); -- cgit v1.2.3 From 815b043ddac433eecb2899cb2090495b27f77aac Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Wed, 8 Feb 2012 14:16:47 -0800 Subject: cs5535-mfgpt: don't call __init function from __devinit Fix and reset_all_timers() to be __devinit and not __init since the function gets called from cs5535_mfgpt_probe which is __devinit. Signed-off-by: Danny Kukawka Acked-by: Andres Salomon Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/misc/cs5535-mfgpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc') diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index bc685bfc4c33..f836359226ac 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c @@ -246,7 +246,7 @@ EXPORT_SYMBOL_GPL(cs5535_mfgpt_write); * Jordan tells me that he and Mitch once played w/ it, but it's unclear * what the results of that were (and they experienced some instability). */ -static void __init reset_all_timers(void) +static void __devinit reset_all_timers(void) { uint32_t val, dummy; -- cgit v1.2.3 From ef77d83fd7a2f37a20d9e37ac156f18e7e105c75 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Fri, 24 Feb 2012 19:46:32 +0100 Subject: misc: fsa9480: Remove obsolete cleanup for clientdata A few new i2c-drivers came into the kernel which clear the clientdata-pointer on exit or error. This is obsolete meanwhile, the core will do it. Signed-off-by: Wolfram Sang Acked-by: Kyungmin Park Signed-off-by: Greg Kroah-Hartman --- drivers/misc/fsa9480.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c index 483d6b738095..ac96c3a4034a 100644 --- a/drivers/misc/fsa9480.c +++ b/drivers/misc/fsa9480.c @@ -458,7 +458,6 @@ fail2: if (client->irq) free_irq(client->irq, usbsw); fail1: - i2c_set_clientdata(client, NULL); kfree(usbsw); return ret; } @@ -468,7 +467,6 @@ static int __devexit fsa9480_remove(struct i2c_client *client) struct fsa9480_usbsw *usbsw = i2c_get_clientdata(client); if (client->irq) free_irq(client->irq, usbsw); - i2c_set_clientdata(client, NULL); sysfs_remove_group(&client->dev.kobj, &fsa9480_group); device_init_wakeup(&client->dev, 0); -- cgit v1.2.3 From 3734f7858f4334d51c1cd77deff3e1e66517e261 Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Sun, 19 Feb 2012 18:28:01 +0100 Subject: misc: bmp085: Handle jiffies overflow correctly By using the time_is_before_jiffies() macro instead of normal arithmetic, the jiffies overflow is handled correctly. Signed-off-by: Bernhard Walle Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/misc/bmp085.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/misc') diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c index 3c534aba6272..b088abc0f45b 100644 --- a/drivers/misc/bmp085.c +++ b/drivers/misc/bmp085.c @@ -234,7 +234,8 @@ static s32 bmp085_get_pressure(struct bmp085_data *data, int *pressure) int status; /* alt least every second force an update of the ambient temperature */ - if (data->last_temp_measurement + 1*HZ < jiffies) { + if (data->last_temp_measurement == 0 || + time_is_before_jiffies(data->last_temp_measurement + 1*HZ)) { status = bmp085_get_temperature(data, NULL); if (status != 0) goto exit; -- cgit v1.2.3 From b222258ac11cae3e0350fe5992ad164a7b128103 Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Sat, 25 Feb 2012 10:28:12 +0100 Subject: misc: bmp085: Use unsigned long to store jiffies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes following compilation warning: drivers/misc/bmp085.c: In function ‘bmp085_get_pressure’: drivers/misc/bmp085.c:238:4: warning: comparison of distinct pointer types lacks a cast [enabled by default] Signed-off-by: Bernhard Walle Signed-off-by: Greg Kroah-Hartman --- drivers/misc/bmp085.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc') diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c index b088abc0f45b..76c3064629f1 100644 --- a/drivers/misc/bmp085.c +++ b/drivers/misc/bmp085.c @@ -87,7 +87,7 @@ struct bmp085_data { u32 raw_temperature; u32 raw_pressure; unsigned char oversampling_setting; - u32 last_temp_measurement; + unsigned long last_temp_measurement; s32 b6; /* calculated temperature correction coefficient */ }; -- cgit v1.2.3