aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/slaves/w1_ds2781.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/slaves/w1_ds2781.c')
-rw-r--r--drivers/w1/slaves/w1_ds2781.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/w1/slaves/w1_ds2781.c b/drivers/w1/slaves/w1_ds2781.c
index 0d0c7985293..877daf74159 100644
--- a/drivers/w1/slaves/w1_ds2781.c
+++ b/drivers/w1/slaves/w1_ds2781.c
@@ -58,30 +58,16 @@ int w1_ds2781_io(struct device *dev, char *buf, int addr, size_t count,
58 if (!dev) 58 if (!dev)
59 return -ENODEV; 59 return -ENODEV;
60 60
61 mutex_lock(&sl->master->mutex); 61 mutex_lock(&sl->master->bus_mutex);
62 62
63 ret = w1_ds2781_do_io(dev, buf, addr, count, io); 63 ret = w1_ds2781_do_io(dev, buf, addr, count, io);
64 64
65 mutex_unlock(&sl->master->mutex); 65 mutex_unlock(&sl->master->bus_mutex);
66 66
67 return ret; 67 return ret;
68} 68}
69EXPORT_SYMBOL(w1_ds2781_io); 69EXPORT_SYMBOL(w1_ds2781_io);
70 70
71int w1_ds2781_io_nolock(struct device *dev, char *buf, int addr, size_t count,
72 int io)
73{
74 int ret;
75
76 if (!dev)
77 return -ENODEV;
78
79 ret = w1_ds2781_do_io(dev, buf, addr, count, io);
80
81 return ret;
82}
83EXPORT_SYMBOL(w1_ds2781_io_nolock);
84
85int w1_ds2781_eeprom_cmd(struct device *dev, int addr, int cmd) 71int w1_ds2781_eeprom_cmd(struct device *dev, int addr, int cmd)
86{ 72{
87 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 73 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
@@ -89,14 +75,14 @@ int w1_ds2781_eeprom_cmd(struct device *dev, int addr, int cmd)
89 if (!dev) 75 if (!dev)
90 return -EINVAL; 76 return -EINVAL;
91 77
92 mutex_lock(&sl->master->mutex); 78 mutex_lock(&sl->master->bus_mutex);
93 79
94 if (w1_reset_select_slave(sl) == 0) { 80 if (w1_reset_select_slave(sl) == 0) {
95 w1_write_8(sl->master, cmd); 81 w1_write_8(sl->master, cmd);
96 w1_write_8(sl->master, addr); 82 w1_write_8(sl->master, addr);
97 } 83 }
98 84
99 mutex_unlock(&sl->master->mutex); 85 mutex_unlock(&sl->master->bus_mutex);
100 return 0; 86 return 0;
101} 87}
102EXPORT_SYMBOL(w1_ds2781_eeprom_cmd); 88EXPORT_SYMBOL(w1_ds2781_eeprom_cmd);