W1: split master mutex to avoid deadlocks.
[firefly-linux-kernel-4.4.55.git] / drivers / w1 / slaves / w1_ds2423.c
index 7a7dbe5026f1f0495efa8451a004fb41e4374eb6..40a10b5ed120c134d14e77481d1fdf70101ed2ef 100644 (file)
@@ -66,7 +66,7 @@ static ssize_t w1_counter_read(struct device *device,
        wrbuf[0]        = 0xA5;
        wrbuf[1]        = rom_addr & 0xFF;
        wrbuf[2]        = rom_addr >> 8;
-       mutex_lock(&dev->mutex);
+       mutex_lock(&dev->bus_mutex);
        if (!w1_reset_select_slave(sl)) {
                w1_write_block(dev, wrbuf, 3);
                read_byte_count = 0;
@@ -124,7 +124,7 @@ static ssize_t w1_counter_read(struct device *device,
        } else {
                c -= snprintf(out_buf + PAGE_SIZE - c, c, "Connection error");
        }
-       mutex_unlock(&dev->mutex);
+       mutex_unlock(&dev->bus_mutex);
        return PAGE_SIZE - c;
 }