Skip to contentSkip to conversation

RFC: Correct behaviour for RO sysfs entries?

lm-sensors Henrique de Moraes Holschuh 1 participant 1 message Nov 10, 2005

lore
Share & tools
lore
#0 lore raw

I have started the process of updating lm85.c to the sysfs-interface spec, now that I have a better idea against what to patch for (I am using Greg's git tree as the base).

What should a hwmon driver do upon a write to a sysfs entry that is currently unchangeable? This is missing in the sysfs-interface description. The kernel generic sysfs guidelines seems to encourage one to return errors where applicable.

I could silently ignore the write (most drivers currently do this) and let the user try to figure it out why writing to something has no effect, or I could return an error, thus failing the write right there.

Is there a good reason for not returning errors and instead just silently ignore them (e.g. when trying to write to pwm# when auto_pwm is enabled)? Also, can the mode of a hwmon device's sysfs entry be dynamically changed?

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh