Commit 1539af85 authored by Andy Grover's avatar Andy Grover

ACPI: Make proc write interfaces work (Pavel Machek)

parent 5e50cc1b
...@@ -794,7 +794,7 @@ acpi_processor_register_performance ( ...@@ -794,7 +794,7 @@ acpi_processor_register_performance (
} }
EXPORT_SYMBOL(acpi_processor_register_performance); EXPORT_SYMBOL(acpi_processor_register_performance);
/* for the rest of it, check processor_perf.c */ /* for the rest of it, check cpufreq/acpi.c */
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -1350,8 +1350,8 @@ static int ...@@ -1350,8 +1350,8 @@ static int
acpi_processor_write_throttling ( acpi_processor_write_throttling (
struct file *file, struct file *file,
const char *buffer, const char *buffer,
unsigned long count, size_t count,
void *data) loff_t *data)
{ {
int result = 0; int result = 0;
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *) data;
...@@ -1412,8 +1412,8 @@ static int ...@@ -1412,8 +1412,8 @@ static int
acpi_processor_write_limit ( acpi_processor_write_limit (
struct file *file, struct file *file,
const char *buffer, const char *buffer,
unsigned long count, size_t count,
void *data) loff_t *data)
{ {
int result = 0; int result = 0;
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *) data;
...@@ -1511,7 +1511,7 @@ acpi_processor_add_fs ( ...@@ -1511,7 +1511,7 @@ acpi_processor_add_fs (
ACPI_PROCESSOR_FILE_THROTTLING)); ACPI_PROCESSOR_FILE_THROTTLING));
else { else {
entry->proc_fops = &acpi_processor_throttling_fops; entry->proc_fops = &acpi_processor_throttling_fops;
entry->write_proc = acpi_processor_write_throttling; entry->proc_fops->write = acpi_processor_write_throttling;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1524,7 +1524,7 @@ acpi_processor_add_fs ( ...@@ -1524,7 +1524,7 @@ acpi_processor_add_fs (
ACPI_PROCESSOR_FILE_LIMIT)); ACPI_PROCESSOR_FILE_LIMIT));
else { else {
entry->proc_fops = &acpi_processor_limit_fops; entry->proc_fops = &acpi_processor_limit_fops;
entry->write_proc = acpi_processor_write_limit; entry->proc_fops->write = acpi_processor_write_limit;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -877,10 +877,12 @@ static int ...@@ -877,10 +877,12 @@ static int
acpi_thermal_write_trip_points ( acpi_thermal_write_trip_points (
struct file *file, struct file *file,
const char *buffer, const char *buffer,
unsigned long count, size_t count,
void *data) loff_t *ppos)
{ {
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_thermal *tz = (struct acpi_thermal *)m->private;
char limit_string[25] = {'\0'}; char limit_string[25] = {'\0'};
int critical, hot, passive, active0, active1; int critical, hot, passive, active0, active1;
...@@ -944,8 +946,8 @@ static int ...@@ -944,8 +946,8 @@ static int
acpi_thermal_write_cooling_mode ( acpi_thermal_write_cooling_mode (
struct file *file, struct file *file,
const char *buffer, const char *buffer,
unsigned long count, size_t count,
void *data) loff_t *data)
{ {
int result = 0; int result = 0;
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *) data;
...@@ -1004,8 +1006,8 @@ static int ...@@ -1004,8 +1006,8 @@ static int
acpi_thermal_write_polling ( acpi_thermal_write_polling (
struct file *file, struct file *file,
const char *buffer, const char *buffer,
unsigned long count, size_t count,
void *data) loff_t *data)
{ {
int result = 0; int result = 0;
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *) data;
...@@ -1079,10 +1081,10 @@ acpi_thermal_add_fs ( ...@@ -1079,10 +1081,10 @@ acpi_thermal_add_fs (
if (!entry) if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_POLLING_FREQ)); ACPI_THERMAL_FILE_TRIP_POINTS));
else { else {
entry->proc_fops = &acpi_thermal_trip_fops; entry->proc_fops = &acpi_thermal_trip_fops;
entry->write_proc = acpi_thermal_write_trip_points; entry->proc_fops->write = acpi_thermal_write_trip_points;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1095,7 +1097,7 @@ acpi_thermal_add_fs ( ...@@ -1095,7 +1097,7 @@ acpi_thermal_add_fs (
ACPI_THERMAL_FILE_COOLING_MODE)); ACPI_THERMAL_FILE_COOLING_MODE));
else { else {
entry->proc_fops = &acpi_thermal_cooling_fops; entry->proc_fops = &acpi_thermal_cooling_fops;
entry->write_proc = acpi_thermal_write_cooling_mode; entry->proc_fops->write = acpi_thermal_write_cooling_mode;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1108,7 +1110,7 @@ acpi_thermal_add_fs ( ...@@ -1108,7 +1110,7 @@ acpi_thermal_add_fs (
ACPI_THERMAL_FILE_POLLING_FREQ)); ACPI_THERMAL_FILE_POLLING_FREQ));
else { else {
entry->proc_fops = &acpi_thermal_polling_fops; entry->proc_fops = &acpi_thermal_polling_fops;
entry->write_proc = acpi_thermal_write_polling; entry->proc_fops->write = acpi_thermal_write_polling;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -309,8 +309,8 @@ static int toshiba_lcd_open_fs(struct inode *inode, struct file *file) ...@@ -309,8 +309,8 @@ static int toshiba_lcd_open_fs(struct inode *inode, struct file *file)
} }
static int static int
proc_write_lcd(struct file* file, const char* buffer, unsigned long count, proc_write_lcd(struct file* file, const char* buffer, size_t count,
void* data) loff_t* data)
{ {
int value; int value;
/*int byte_count;*/ /*int byte_count;*/
...@@ -358,8 +358,8 @@ static int toshiba_video_open_fs(struct inode *inode, struct file *file) ...@@ -358,8 +358,8 @@ static int toshiba_video_open_fs(struct inode *inode, struct file *file)
} }
static int static int
proc_write_video(struct file* file, const char* buffer, unsigned long count, proc_write_video(struct file* file, const char* buffer, size_t count,
void* data) loff_t* data)
{ {
int value; int value;
const char* buffer_end = buffer + count; const char* buffer_end = buffer + count;
...@@ -423,8 +423,8 @@ static int toshiba_fan_open_fs(struct inode *inode, struct file *file) ...@@ -423,8 +423,8 @@ static int toshiba_fan_open_fs(struct inode *inode, struct file *file)
} }
static int static int
proc_write_fan(struct file* file, const char* buffer, unsigned long count, proc_write_fan(struct file* file, const char* buffer, size_t count,
void* data) loff_t* data)
{ {
int value; int value;
u32 hci_result; u32 hci_result;
...@@ -476,8 +476,8 @@ static int toshiba_keys_open_fs(struct inode *inode, struct file *file) ...@@ -476,8 +476,8 @@ static int toshiba_keys_open_fs(struct inode *inode, struct file *file)
} }
static int static int
proc_write_keys(struct file* file, const char* buffer, unsigned long count, proc_write_keys(struct file* file, const char* buffer, size_t count,
void* data) loff_t* data)
{ {
int value; int value;
...@@ -518,28 +518,28 @@ add_device(void) ...@@ -518,28 +518,28 @@ add_device(void)
toshiba_proc_dir); toshiba_proc_dir);
if (proc) { if (proc) {
proc->proc_fops = &toshiba_lcd_fops; proc->proc_fops = &toshiba_lcd_fops;
proc->write_proc = proc_write_lcd; proc->proc_fops->write = proc_write_lcd;
} }
proc = create_proc_entry(PROC_VIDEO, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_VIDEO, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir); toshiba_proc_dir);
if (proc) { if (proc) {
proc->proc_fops = &toshiba_video_fops; proc->proc_fops = &toshiba_video_fops;
proc->write_proc = proc_write_video; proc->proc_fops->write = proc_write_video;
} }
proc = create_proc_entry(PROC_FAN, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_FAN, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir); toshiba_proc_dir);
if (proc) { if (proc) {
proc->proc_fops = &toshiba_fan_fops; proc->proc_fops = &toshiba_fan_fops;
proc->write_proc = proc_write_fan; proc->proc_fops->write = proc_write_fan;
} }
proc = create_proc_entry(PROC_KEYS, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_KEYS, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir); toshiba_proc_dir);
if (proc) { if (proc) {
proc->proc_fops = &toshiba_keys_fops; proc->proc_fops = &toshiba_keys_fops;
proc->write_proc = proc_write_keys; proc->proc_fops->write = proc_write_keys;
} }
proc = create_proc_entry(PROC_VERSION, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_VERSION, S_IFREG | S_IRUGO | S_IWUSR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment