hwmon: (lm85) Use dynamic sysfs callbacks
commitb353a487b9d835da331edb443afedfd7977b3d76
authorJean Delvare <khali@linux-fr.org>
Thu, 5 Jul 2007 18:36:12 +0000 (5 20:36 +0200)
committerMark M. Hoffman <mhoffman@lightlink.com>
Wed, 10 Oct 2007 02:56:30 +0000 (9 22:56 -0400)
treed4fc64e99a9c9f7085437f581a24088befab7dfa
parent1beeffe43311f64df8dd0ab08ff6b1858c58363f
hwmon: (lm85) Use dynamic sysfs callbacks

This lets us get rid of macro-generated functions and shrinks the
driver size by about 10%. I used a new style suggested by Mark M.
Hoffman to retrieve the channel number. Instead of:

struct sensor_device_attribute *sda = to_sensor_dev_attr(attr);
int nr = sda->index;

I do:

int nr = to_sensor_dev_attr(attr)->index;

This looks better, and even allows the compiler to do some minor
optimizations.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
drivers/hwmon/lm85.c