hwmon: (jc42) do not allow writing to locked registers
commit
2c6315da6a1657a49e03970a4084dc3d1958ad70 upstream.
On systems where the temperature sensor is actually used, the BIOS is
likely to have locked the alarm registers. In that case, all writes
through the corresponding sysfs files would be silently ignored.
To prevent this, detect the locks and make the affected sysfs files
read-only.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>