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