Skip to contentSkip to conversation

f71882fg suggestions

lm-sensors Hans de Goede 1 participant 1 message Jul 8, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Krzysztof Helt

Hi,

Here are 3 suggestions to your f71882fg driver (I have no code to comment directly, but they should be easy to locate).

1. You should be an author in the MODULE_AUTHOR() macro.

Good point!

Quoted 1 line

2. You should not set data.addr in f71882fg_find()

Wrong, I must do that, because after that I call f71882fg_read8(data, ...) and 71882fg_read8 needs addr to be set, notice that I'm operating on a temporary data struct on the stack here, which is used only to call f71882fg_read8, to read the config register and see if the hwmon is enabled.

Quoted 4 lines

3. I wonder why you add all these sysfs entries one by one (in loops) instead of creating a group and add them with one function call (see the asb100 driver). You need to create 3 groups, one for each loop.

I do it this way because I have an array of attributes, not an array of attribute addresses as the group register function expects. Walking my array with a loop is easier then then first creating an array of addresses (with a loop, or handfilling it, which is even worse) and then calling the group register function.

Now if there would be a group register function which I can pass the address of a set of attr, the offsets between all the attr (one needs to specify the offset ebcause we use sensor_attr not sysfs_attr which is larger) and the no of attr, then that would be great.

Regards,

Hans

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