aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/lm77.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/lm77.c')
-rw-r--r--drivers/i2c/chips/lm77.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/i2c/chips/lm77.c b/drivers/i2c/chips/lm77.c
index f56b7a37de75..9d15cd5189f6 100644
--- a/drivers/i2c/chips/lm77.c
+++ b/drivers/i2c/chips/lm77.c
@@ -103,7 +103,7 @@ static inline int LM77_TEMP_FROM_REG(u16 reg)
103 103
104/* read routines for temperature limits */ 104/* read routines for temperature limits */
105#define show(value) \ 105#define show(value) \
106static ssize_t show_##value(struct device *dev, char *buf) \ 106static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
107{ \ 107{ \
108 struct lm77_data *data = lm77_update_device(dev); \ 108 struct lm77_data *data = lm77_update_device(dev); \
109 return sprintf(buf, "%d\n", data->value); \ 109 return sprintf(buf, "%d\n", data->value); \
@@ -116,17 +116,17 @@ show(temp_max);
116show(alarms); 116show(alarms);
117 117
118/* read routines for hysteresis values */ 118/* read routines for hysteresis values */
119static ssize_t show_temp_crit_hyst(struct device *dev, char *buf) 119static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
120{ 120{
121 struct lm77_data *data = lm77_update_device(dev); 121 struct lm77_data *data = lm77_update_device(dev);
122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst); 122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst);
123} 123}
124static ssize_t show_temp_min_hyst(struct device *dev, char *buf) 124static ssize_t show_temp_min_hyst(struct device *dev, struct device_attribute *attr, char *buf)
125{ 125{
126 struct lm77_data *data = lm77_update_device(dev); 126 struct lm77_data *data = lm77_update_device(dev);
127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst); 127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst);
128} 128}
129static ssize_t show_temp_max_hyst(struct device *dev, char *buf) 129static ssize_t show_temp_max_hyst(struct device *dev, struct device_attribute *attr, char *buf)
130{ 130{
131 struct lm77_data *data = lm77_update_device(dev); 131 struct lm77_data *data = lm77_update_device(dev);
132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst); 132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst);
@@ -134,7 +134,7 @@ static ssize_t show_temp_max_hyst(struct device *dev, char *buf)
134 134
135/* write routines */ 135/* write routines */
136#define set(value, reg) \ 136#define set(value, reg) \
137static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 137static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
138{ \ 138{ \
139 struct i2c_client *client = to_i2c_client(dev); \ 139 struct i2c_client *client = to_i2c_client(dev); \
140 struct lm77_data *data = i2c_get_clientdata(client); \ 140 struct lm77_data *data = i2c_get_clientdata(client); \
@@ -152,7 +152,7 @@ set(temp_max, LM77_REG_TEMP_MAX);
152 152
153/* hysteresis is stored as a relative value on the chip, so it has to be 153/* hysteresis is stored as a relative value on the chip, so it has to be
154 converted first */ 154 converted first */
155static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t count) 155static ssize_t set_temp_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
156{ 156{
157 struct i2c_client *client = to_i2c_client(dev); 157 struct i2c_client *client = to_i2c_client(dev);
158 struct lm77_data *data = i2c_get_clientdata(client); 158 struct lm77_data *data = i2c_get_clientdata(client);
@@ -167,7 +167,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t co
167} 167}
168 168
169/* preserve hysteresis when setting T_crit */ 169/* preserve hysteresis when setting T_crit */
170static ssize_t set_temp_crit(struct device *dev, const char *buf, size_t count) 170static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
171{ 171{
172 struct i2c_client *client = to_i2c_client(dev); 172 struct i2c_client *client = to_i2c_client(dev);
173 struct lm77_data *data = i2c_get_clientdata(client); 173 struct lm77_data *data = i2c_get_clientdata(client);