[PATCH 0/2] w1: slaves: w1_therm: Add sysfs entry for current temperature

From: Mariusz Gorski
Date: Tue Jan 06 2015 - 09:33:47 EST


DS18B20 and it's brothers are pretty popular in the RaspberryPi world
when it comes to temperature measurement. All tutorials on the Internet
use the same way of parsing the output of the w1_slave sysfs file.
These patches add a dedicated sysfs entry called 'temp' whose only job
is to output the current temperature.

What could be improved here is the way how dev->bus_mutex is locked/unlocked,
which is split right now between two functions - maybe it would be better
to move all dev->bus_mutex locking into read_rom() and introduce another
mutex for protecting the slave's structures (e.g. family_data).

Mariusz Gorski (2):
w1: slaves: w1_therm: Extract read_rom function
w1: slaves: w1_therm: Add temp attribute

drivers/w1/slaves/w1_therm.c | 83 ++++++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 18 deletions(-)

--
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/