Messages in this thread | | | Date | Tue, 6 Jan 2015 20:00:03 -0600 | From | David Fries <> | Subject | Re: [PATCH 2/2] w1: slaves: w1_therm: Add temp attribute |
| |
On Tue, Jan 06, 2015 at 03:29:56PM +0100, Mariusz Gorski wrote: > Add new attribute to simplify reading of current temperature.
> +static ssize_t temp_show(struct device *device, > + struct device_attribute *attr, char *buf) > +{ > + struct w1_slave *sl = dev_to_w1_slave(device); > + struct w1_master *dev = sl->master; > + u8 rom[9], verdict; > + int temp; > + > + if (mutex_lock_interruptible(&dev->bus_mutex)) > + return -EINTR; > + > + memset(rom, 0, sizeof(rom)); > + > + verdict = read_rom(device, rom); > + > + if (verdict < 0) > + return verdict;
I wanted to point out that this returns without unlocking bus_mutex.
-- David Fries <david@fries.net> PGP pub CB1EE8F0 http://fries.net/~david/
| |