Skip to contentSkip to conversation

lm75: some optimisations

RFC PATCH In review Shubhrajyoti D 2 participants 2 messages Sep 9, 2010 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 lm75: some optimisations

Functions that used only at probe may be optimised.

---
 drivers/hwmon/lm75.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/lm75.c +2 -2
index ab5b87a..7857b94 100644
@@ -134,7 +134,7 @@ static const struct attribute_group lm75_group = {
 
 /* device probe and removal */
 
-static int
+static int __devinit
 lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct lm75_data *data;
@@ -196,7 +196,7 @@ exit_free:
 	return status;
 }
 
-static int lm75_remove(struct i2c_client *client)
+static int __devexit lm75_remove(struct i2c_client *client)
 {
 	struct lm75_data *data = i2c_get_clientdata(client);
 
Signature · 7 lines
1.7.0.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 21 lines · Shubhrajyoti D

Functions that used only at probe may be optimised.

---
 drivers/hwmon/lm75.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/lm75.c +1 -1
index ab5b87a..7857b94 100644
@@ -134,7 +134,7 @@ static const struct attribute_group lm75_group = {
 
 /* device probe and removal */
 
-static int
+static int __devinit
 lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct lm75_data *data;

drivers/hwmon/lm75.c exit_free: · line 202

Quoted 8 lines
drivers/hwmon/lm75.c +1 -1
@@ -196,7 +196,7 @@ exit_free:
 	return status;
 }
 
-static int lm75_remove(struct i2c_client *client)
+static int __devexit lm75_remove(struct i2c_client *client)
 {
 	struct lm75_data *data = i2c_get_clientdata(client);
 

Other drivers reference the exit function using __devexit_p():

lm78.c:static int __devexit lm78_isa_remove(struct platform_device *pdev);
lm78.c: .remove = __devexit_p(lm78_isa_remove),

You might want to do the same.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors