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>