Skip to contentSkip to conversation

drivers/i2c/chips/pc87360.c - drivers/i2c/i2c-core.c: (dynamic sysfs callbacks) update device attribute callbacks

PATCH In review Yani Ioannou 1 participant 1 message May 14, 2005 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 7/12 drivers/i2c/chips/pc87360.c - drivers/i2c/i2c-core.c: (dynamic sysfs callbacks) update device attribute callbacks

---

 chips/pc87360.c    |   68 ++++++++++++++++++++++++++---------------------------
 chips/pcf8574.c    |    6 ++--
 chips/pcf8591.c    |   10 +++----
 chips/sis5595.c    |   34 +++++++++++++-------------
 chips/smsc47b397.c |    4 +--
 chips/smsc47m1.c   |   20 +++++++--------
 chips/via686a.c    |   32 ++++++++++++------------
 chips/w83627hf.c   |   56 +++++++++++++++++++++----------------------
 chips/w83781d.c    |   52 ++++++++++++++++++++--------------------
 chips/w83l785ts.c  |    4 +--
 i2c-core.c         |    4 +--
 11 files changed, 145 insertions(+), 145 deletions(-)
drivers/i2c/chips/pc87360.c +34 -34
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/pc87360.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/pc87360.c
@@ -282,32 +282,32 @@ static ssize_t set_fan_min(struct device
 }
 
 #define show_and_set_fan(offset) \
-static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \
+static ssize_t show_fan##offset##_input(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \
 		       FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
 } \
-static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \
+static ssize_t show_fan##offset##_min(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \
 		       FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
 } \
-static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \
+static ssize_t show_fan##offset##_div(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", \
 		       FAN_DIV_FROM_REG(data->fan_status[offset-1])); \
 } \
-static ssize_t show_fan##offset##_status(struct device *dev, char *buf) \
+static ssize_t show_fan##offset##_status(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", \
 		       FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \
 } \
 static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	return set_fan_min(dev, buf, count, offset-1); \
 } \
@@ -324,7 +324,7 @@ show_and_set_fan(2)
 show_and_set_fan(3)
 
 #define show_and_set_pwm(offset) \
-static ssize_t show_pwm##offset(struct device *dev, char *buf) \
+static ssize_t show_pwm##offset(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", \
@@ -333,7 +333,7 @@ static ssize_t show_pwm##offset(struct d
 						      offset-1))); \
 } \
 static ssize_t set_pwm##offset(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -354,31 +354,31 @@ show_and_set_pwm(2)
 show_and_set_pwm(3)
 
 #define show_and_set_in(offset) \
-static ssize_t show_in##offset##_input(struct device *dev, char *buf) \
+static ssize_t show_in##offset##_input(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
 		       data->in_vref)); \
 } \
-static ssize_t show_in##offset##_min(struct device *dev, char *buf) \
+static ssize_t show_in##offset##_min(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
 		       data->in_vref)); \
 } \
-static ssize_t show_in##offset##_max(struct device *dev, char *buf) \
+static ssize_t show_in##offset##_max(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
 		       data->in_vref)); \
 } \
-static ssize_t show_in##offset##_status(struct device *dev, char *buf) \
+static ssize_t show_in##offset##_status(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", data->in_status[offset]); \
 } \
 static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -392,7 +392,7 @@ static ssize_t set_in##offset##_min(stru
 	return count; \
 } \
 static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -427,37 +427,37 @@ show_and_set_in(9)
 show_and_set_in(10)
 
 #define show_and_set_therm(offset) \
-static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_input(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \
 		       data->in_vref)); \
 } \
-static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_min(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \
 		       data->in_vref)); \
 } \
-static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_max(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \
 		       data->in_vref)); \
 } \
-static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_crit(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \
 		       data->in_vref)); \
 } \
-static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_status(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%u\n", data->in_status[offset+7]); \
 } \
 static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -471,7 +471,7 @@ static ssize_t set_temp##offset##_min(st
 	return count; \
 } \
 static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -485,7 +485,7 @@ static ssize_t set_temp##offset##_max(st
 	return count; \
 } \
 static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -512,19 +512,19 @@ show_and_set_therm(4)
 show_and_set_therm(5)
 show_and_set_therm(6)
 
-static ssize_t show_vid(struct device *dev, char *buf)
+static ssize_t show_vid(struct device *dev, char *buf, void *private)
 {
 	struct pc87360_data *data = pc87360_update_device(dev);
 	return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
 }
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 
-static ssize_t show_vrm(struct device *dev, char *buf)
+static ssize_t show_vrm(struct device *dev, char *buf, void *private)
 {
 	struct pc87360_data *data = pc87360_update_device(dev);
 	return sprintf(buf, "%u\n", data->vrm);
 }
-static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
+static ssize_t set_vrm(struct device *dev, const char *buf, size_t count, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pc87360_data *data = i2c_get_clientdata(client);
@@ -533,7 +533,7 @@ static ssize_t set_vrm(struct device *de
 }
 static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
 
-static ssize_t show_in_alarms(struct device *dev, char *buf)
+static ssize_t show_in_alarms(struct device *dev, char *buf, void *private)
 {
 	struct pc87360_data *data = pc87360_update_device(dev);
 	return sprintf(buf, "%u\n", data->in_alarms);
@@ -541,33 +541,33 @@ static ssize_t show_in_alarms(struct dev
 static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL);
 
 #define show_and_set_temp(offset) \
-static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_input(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
 } \
-static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_min(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
 } \
-static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_max(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
 }\
-static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_crit(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \
 }\
-static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \
+static ssize_t show_temp##offset##_status(struct device *dev, char *buf, void *private) \
 { \
 	struct pc87360_data *data = pc87360_update_device(dev); \
 	return sprintf(buf, "%d\n", data->temp_status[offset-1]); \
 }\
 static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -581,7 +581,7 @@ static ssize_t set_temp##offset##_min(st
 	return count; \
 } \
 static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -595,7 +595,7 @@ static ssize_t set_temp##offset##_max(st
 	return count; \
 } \
 static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \
-	size_t count) \
+	size_t count, void *private) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct pc87360_data *data = i2c_get_clientdata(client); \
@@ -622,7 +622,7 @@ show_and_set_temp(1)
 show_and_set_temp(2)
 show_and_set_temp(3)
 
-static ssize_t show_temp_alarms(struct device *dev, char *buf)
+static ssize_t show_temp_alarms(struct device *dev, char *buf, void *private)
 {
 	struct pc87360_data *data = pc87360_update_device(dev);
 	return sprintf(buf, "%u\n", data->temp_alarms);
drivers/i2c/chips/pcf8574.c +3 -3
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/pcf8574.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/pcf8574.c
@@ -76,7 +76,7 @@ static struct i2c_driver pcf8574_driver 
 };
 
 /* following are the sysfs callback functions */
-static ssize_t show_read(struct device *dev, char *buf)
+static ssize_t show_read(struct device *dev, char *buf, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pcf8574_data *data = i2c_get_clientdata(client);
@@ -86,14 +86,14 @@ static ssize_t show_read(struct device *
 
 static DEVICE_ATTR(read, S_IRUGO, show_read, NULL);
 
-static ssize_t show_write(struct device *dev, char *buf)
+static ssize_t show_write(struct device *dev, char *buf, void *private)
 {
 	struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev));
 	return sprintf(buf, "%u\n", data->write);
 }
 
 static ssize_t set_write(struct device *dev, const char *buf,
-			 size_t count)
+			 size_t count, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pcf8574_data *data = i2c_get_clientdata(client);
drivers/i2c/chips/pcf8591.c +5 -5
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/pcf8591.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/pcf8591.c
@@ -100,7 +100,7 @@ static struct i2c_driver pcf8591_driver 
 
 /* following are the sysfs callback functions */
 #define show_in_channel(channel)					\
-static ssize_t show_in##channel##_input(struct device *dev, char *buf)	\
+static ssize_t show_in##channel##_input(struct device *dev, char *buf, void *private)	\
 {									\
 	return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\
 }									\
@@ -112,13 +112,13 @@ show_in_channel(1);
 show_in_channel(2);
 show_in_channel(3);
 
-static ssize_t show_out0_ouput(struct device *dev, char *buf)
+static ssize_t show_out0_ouput(struct device *dev, char *buf, void *private)
 {
 	struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
 	return sprintf(buf, "%d\n", data->aout * 10);
 }
 
-static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count)
+static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count, void *private)
 {
 	unsigned int value;
 	struct i2c_client *client = to_i2c_client(dev);
@@ -134,13 +134,13 @@ static ssize_t set_out0_output(struct de
 static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO, 
 		   show_out0_ouput, set_out0_output);
 
-static ssize_t show_out0_enable(struct device *dev, char *buf)
+static ssize_t show_out0_enable(struct device *dev, char *buf, void *private)
 {
 	struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
 	return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF)));
 }
 
-static ssize_t set_out0_enable(struct device *dev, const char *buf, size_t count)
+static ssize_t set_out0_enable(struct device *dev, const char *buf, size_t count, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pcf8591_data *data = i2c_get_clientdata(client);
drivers/i2c/chips/sis5595.c +17 -17
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/sis5595.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/sis5595.c
@@ -256,29 +256,29 @@ static ssize_t set_in_max(struct device 
 
 #define show_in_offset(offset)					\
 static ssize_t							\
-	show_in##offset (struct device *dev, char *buf)		\
+	show_in##offset (struct device *dev, char *buf, void *private)		\
 {								\
 	return show_in(dev, buf, offset);			\
 }								\
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, 		\
 		show_in##offset, NULL);				\
 static ssize_t							\
-	show_in##offset##_min (struct device *dev, char *buf)	\
+	show_in##offset##_min (struct device *dev, char *buf, void *private)	\
 {								\
 	return show_in_min(dev, buf, offset);			\
 }								\
 static ssize_t							\
-	show_in##offset##_max (struct device *dev, char *buf)	\
+	show_in##offset##_max (struct device *dev, char *buf, void *private)	\
 {								\
 	return show_in_max(dev, buf, offset);			\
 }								\
 static ssize_t set_in##offset##_min (struct device *dev,	\
-		const char *buf, size_t count)			\
+		const char *buf, size_t count, void *private)			\
 {								\
 	return set_in_min(dev, buf, count, offset);		\
 }								\
 static ssize_t set_in##offset##_max (struct device *dev,	\
-		const char *buf, size_t count)			\
+		const char *buf, size_t count, void *private)			\
 {								\
 	return set_in_max(dev, buf, count, offset);		\
 }								\
@@ -294,19 +294,19 @@ show_in_offset(3);
 show_in_offset(4);
 
 /* Temperature */
-static ssize_t show_temp(struct device *dev, char *buf)
+static ssize_t show_temp(struct device *dev, char *buf, void *private)
 {
 	struct sis5595_data *data = sis5595_update_device(dev);
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
 }
 
-static ssize_t show_temp_over(struct device *dev, char *buf)
+static ssize_t show_temp_over(struct device *dev, char *buf, void *private)
 {
 	struct sis5595_data *data = sis5595_update_device(dev);
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
 }
 
-static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
+static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct sis5595_data *data = i2c_get_clientdata(client);
@@ -319,13 +319,13 @@ static ssize_t set_temp_over(struct devi
 	return count;
 }
 
-static ssize_t show_temp_hyst(struct device *dev, char *buf)
+static ssize_t show_temp_hyst(struct device *dev, char *buf, void *private)
 {
 	struct sis5595_data *data = sis5595_update_device(dev);
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
 }
 
-static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count)
+static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct sis5595_data *data = i2c_get_clientdata(client);
@@ -426,20 +426,20 @@ static ssize_t set_fan_div(struct device
 }
 
 #define show_fan_offset(offset)						\
-static ssize_t show_fan_##offset (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan(dev, buf, offset - 1);			\
 }									\
-static ssize_t show_fan_##offset##_min (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_min (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan_min(dev, buf, offset - 1);			\
 }									\
-static ssize_t show_fan_##offset##_div (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_div (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan_div(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_fan_##offset##_min (struct device *dev,		\
-		const char *buf, size_t count)				\
+		const char *buf, size_t count, void *private)				\
 {									\
 	return set_fan_min(dev, buf, count, offset - 1);		\
 }									\
@@ -451,13 +451,13 @@ show_fan_offset(1);
 show_fan_offset(2);
 
 static ssize_t set_fan_1_div(struct device *dev, const char *buf,
-		size_t count)
+		size_t count, void *private)
 {
 	return set_fan_div(dev, buf, count, 0) ;
 }
 
 static ssize_t set_fan_2_div(struct device *dev, const char *buf,
-		size_t count)
+		size_t count, void *private)
 {
 	return set_fan_div(dev, buf, count, 1) ;
 }
@@ -467,7 +467,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S
 		show_fan_2_div, set_fan_2_div);
 
 /* Alarms */
-static ssize_t show_alarms(struct device *dev, char *buf)
+static ssize_t show_alarms(struct device *dev, char *buf, void *private)
 {
 	struct sis5595_data *data = sis5595_update_device(dev);
 	return sprintf(buf, "%d\n", data->alarms);
drivers/i2c/chips/smsc47b397.c +2 -2
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/smsc47b397.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/smsc47b397.c
@@ -172,7 +172,7 @@ static ssize_t show_temp(struct device *
 }
 
 #define sysfs_temp(num) \
-static ssize_t show_temp##num(struct device *dev, char *buf) \
+static ssize_t show_temp##num(struct device *dev, char *buf, void *private) \
 { \
 	return show_temp(dev, buf, num-1); \
 } \
@@ -201,7 +201,7 @@ static ssize_t show_fan(struct device *d
 }
 
 #define sysfs_fan(num) \
-static ssize_t show_fan##num(struct device *dev, char *buf) \
+static ssize_t show_fan##num(struct device *dev, char *buf, void *private) \
 { \
 	return show_fan(dev, buf, num-1); \
 } \
drivers/i2c/chips/smsc47m1.c +10 -10
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/smsc47m1.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/smsc47m1.c
@@ -184,7 +184,7 @@ static ssize_t get_pwm_en(struct device 
 	return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr]));
 }
 
-static ssize_t get_alarms(struct device *dev, char *buf)
+static ssize_t get_alarms(struct device *dev, char *buf, void *private)
 {
 	struct smsc47m1_data *data = smsc47m1_update_device(dev, 0);
 	return sprintf(buf, "%d\n", data->alarms);
@@ -298,43 +298,43 @@ static ssize_t set_pwm_en(struct device 
 }
 
 #define fan_present(offset)						\
-static ssize_t get_fan##offset (struct device *dev, char *buf)		\
+static ssize_t get_fan##offset (struct device *dev, char *buf, void *private)		\
 {									\
 	return get_fan(dev, buf, offset - 1);				\
 }									\
-static ssize_t get_fan##offset##_min (struct device *dev, char *buf)	\
+static ssize_t get_fan##offset##_min (struct device *dev, char *buf, void *private)	\
 {									\
 	return get_fan_min(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_fan##offset##_min (struct device *dev,		\
-		const char *buf, size_t count)				\
+		const char *buf, size_t count, void *private)				\
 {									\
 	return set_fan_min(dev, buf, count, offset - 1);		\
 }									\
-static ssize_t get_fan##offset##_div (struct device *dev, char *buf)	\
+static ssize_t get_fan##offset##_div (struct device *dev, char *buf, void *private)	\
 {									\
 	return get_fan_div(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_fan##offset##_div (struct device *dev,		\
-		const char *buf, size_t count)				\
+		const char *buf, size_t count, void *private)				\
 {									\
 	return set_fan_div(dev, buf, count, offset - 1);		\
 }									\
-static ssize_t get_pwm##offset (struct device *dev, char *buf)		\
+static ssize_t get_pwm##offset (struct device *dev, char *buf, void *private)		\
 {									\
 	return get_pwm(dev, buf, offset - 1);				\
 }									\
 static ssize_t set_pwm##offset (struct device *dev,			\
-		const char *buf, size_t count)				\
+		const char *buf, size_t count, void *private)				\
 {									\
 	return set_pwm(dev, buf, count, offset - 1);			\
 }									\
-static ssize_t get_pwm##offset##_en (struct device *dev, char *buf)	\
+static ssize_t get_pwm##offset##_en (struct device *dev, char *buf, void *private)	\
 {									\
 	return get_pwm_en(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_pwm##offset##_en (struct device *dev,		\
-		const char *buf, size_t count)				\
+		const char *buf, size_t count, void *private)				\
 {									\
 	return set_pwm_en(dev, buf, count, offset - 1);			\
 }									\
drivers/i2c/chips/via686a.c +16 -16
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/via686a.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/via686a.c
@@ -386,27 +386,27 @@ static ssize_t set_in_max(struct device 
 }
 #define show_in_offset(offset)					\
 static ssize_t 							\
-	show_in##offset (struct device *dev, char *buf)		\
+	show_in##offset (struct device *dev, char *buf, void *private)		\
 {								\
 	return show_in(dev, buf, offset);			\
 }								\
 static ssize_t 							\
-	show_in##offset##_min (struct device *dev, char *buf)	\
+	show_in##offset##_min (struct device *dev, char *buf, void *private)	\
 {								\
 	return show_in_min(dev, buf, offset);		\
 }								\
 static ssize_t 							\
-	show_in##offset##_max (struct device *dev, char *buf)	\
+	show_in##offset##_max (struct device *dev, char *buf, void *private)	\
 {								\
 	return show_in_max(dev, buf, offset);		\
 }								\
 static ssize_t set_in##offset##_min (struct device *dev, 	\
-		const char *buf, size_t count) 			\
+		const char *buf, size_t count, void *private) 			\
 {								\
 	return set_in_min(dev, buf, count, offset);		\
 }								\
 static ssize_t set_in##offset##_max (struct device *dev,	\
-			const char *buf, size_t count)		\
+			const char *buf, size_t count, void *private)		\
 {								\
 	return set_in_max(dev, buf, count, offset);		\
 }								\
@@ -460,27 +460,27 @@ static ssize_t set_temp_hyst(struct devi
 	return count;
 }
 #define show_temp_offset(offset)					\
-static ssize_t show_temp_##offset (struct device *dev, char *buf)	\
+static ssize_t show_temp_##offset (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_temp(dev, buf, offset - 1);				\
 }									\
 static ssize_t								\
-show_temp_##offset##_over (struct device *dev, char *buf)		\
+show_temp_##offset##_over (struct device *dev, char *buf, void *private)		\
 {									\
 	return show_temp_over(dev, buf, offset - 1);			\
 }									\
 static ssize_t								\
-show_temp_##offset##_hyst (struct device *dev, char *buf)		\
+show_temp_##offset##_hyst (struct device *dev, char *buf, void *private)		\
 {									\
 	return show_temp_hyst(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_temp_##offset##_over (struct device *dev, 		\
-		const char *buf, size_t count) 				\
+		const char *buf, size_t count, void *private) 				\
 {									\
 	return set_temp_over(dev, buf, count, offset - 1);		\
 }									\
 static ssize_t set_temp_##offset##_hyst (struct device *dev, 		\
-		const char *buf, size_t count) 				\
+		const char *buf, size_t count, void *private) 				\
 {									\
 	return set_temp_hyst(dev, buf, count, offset - 1);		\
 }									\
@@ -538,25 +538,25 @@ static ssize_t set_fan_div(struct device
 }
 
 #define show_fan_offset(offset)						\
-static ssize_t show_fan_##offset (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan(dev, buf, offset - 1);				\
 }									\
-static ssize_t show_fan_##offset##_min (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_min (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan_min(dev, buf, offset - 1);			\
 }									\
-static ssize_t show_fan_##offset##_div (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_div (struct device *dev, char *buf, void *private)	\
 {									\
 	return show_fan_div(dev, buf, offset - 1);			\
 }									\
 static ssize_t set_fan_##offset##_min (struct device *dev, 		\
-	const char *buf, size_t count) 					\
+	const char *buf, size_t count, void *private) 					\
 {									\
 	return set_fan_min(dev, buf, count, offset - 1);		\
 }									\
 static ssize_t set_fan_##offset##_div (struct device *dev, 		\
-		const char *buf, size_t count) 				\
+		const char *buf, size_t count, void *private) 				\
 {									\
 	return set_fan_div(dev, buf, count, offset - 1);		\
 }									\
@@ -570,7 +570,7 @@ show_fan_offset(1);
 show_fan_offset(2);
 
 /* Alarms */
-static ssize_t show_alarms(struct device *dev, char *buf) {
+static ssize_t show_alarms(struct device *dev, char *buf, void *private) {
 	struct via686a_data *data = via686a_update_device(dev);
 	return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
 }
drivers/i2c/chips/w83627hf.c +28 -28

203 lines not on this page · raw message

drivers/i2c/chips/w83781d.c +26 -26

178 lines not on this page · raw message

drivers/i2c/chips/w83l785ts.c +2 -2
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/chips/w83l785ts.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/chips/w83l785ts.c
@@ -118,13 +118,13 @@ struct w83l785ts_data {
  * Sysfs stuff
  */
 
-static ssize_t show_temp(struct device *dev, char *buf)
+static ssize_t show_temp(struct device *dev, char *buf, void *private)
 {
 	struct w83l785ts_data *data = w83l785ts_update_device(dev);
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
 }
 
-static ssize_t show_temp_over(struct device *dev, char *buf)
+static ssize_t show_temp_over(struct device *dev, char *buf, void *private)
 {
 	struct w83l785ts_data *data = w83l785ts_update_device(dev);
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
drivers/i2c/i2c-core.c +2 -2
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/drivers/i2c/i2c-core.c linux-2.6.12-rc4-sysfsdyncallback-deviceattr-nowarn/drivers/i2c/i2c-core.c
@@ -103,7 +103,7 @@ static struct class i2c_adapter_class = 
 	.release =	&i2c_adapter_class_dev_release,
 };
 
-static ssize_t show_adapter_name(struct device *dev, char *buf)
+static ssize_t show_adapter_name(struct device *dev, char *buf, void *private)
 {
 	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
 	return sprintf(buf, "%s\n", adap->name);
@@ -117,7 +117,7 @@ static void i2c_client_release(struct de
 	complete(&client->released);
 }
 
-static ssize_t show_client_name(struct device *dev, char *buf)
+static ssize_t show_client_name(struct device *dev, char *buf, void *private)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	return sprintf(buf, "%s\n", client->name);