Commit e2fae0ab authored by Len Brown's avatar Len Brown

Merge branch 'constify' into release

parents fff251f6 c07c9a78
...@@ -743,7 +743,7 @@ DECLARE_FILE_FUNCTIONS(alarm); ...@@ -743,7 +743,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
static struct battery_file { static struct battery_file {
struct file_operations ops; struct file_operations ops;
mode_t mode; mode_t mode;
char *name; const char *name;
} acpi_battery_file[] = { } acpi_battery_file[] = {
FILE_DESCRIPTION_RO(info), FILE_DESCRIPTION_RO(info),
FILE_DESCRIPTION_RO(state), FILE_DESCRIPTION_RO(state),
......
...@@ -682,7 +682,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file) ...@@ -682,7 +682,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
return single_open(file, acpi_ec_read_info, PDE(inode)->data); return single_open(file, acpi_ec_read_info, PDE(inode)->data);
} }
static struct file_operations acpi_ec_info_ops = { static const struct file_operations acpi_ec_info_ops = {
.open = acpi_ec_info_open_fs, .open = acpi_ec_info_open_fs,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
......
...@@ -509,7 +509,7 @@ static ssize_t acpi_processor_write_limit(struct file * file, ...@@ -509,7 +509,7 @@ static ssize_t acpi_processor_write_limit(struct file * file,
return count; return count;
} }
struct file_operations acpi_processor_limit_fops = { const struct file_operations acpi_processor_limit_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_processor_limit_open_fs, .open = acpi_processor_limit_open_fs,
.read = seq_read, .read = seq_read,
......
...@@ -1291,7 +1291,7 @@ static ssize_t acpi_processor_write_throttling(struct file *file, ...@@ -1291,7 +1291,7 @@ static ssize_t acpi_processor_write_throttling(struct file *file,
return count; return count;
} }
struct file_operations acpi_processor_throttling_fops = { const struct file_operations acpi_processor_throttling_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_processor_throttling_open_fs, .open = acpi_processor_throttling_open_fs,
.read = seq_read, .read = seq_read,
......
...@@ -484,9 +484,9 @@ static int ...@@ -484,9 +484,9 @@ static int
acpi_sbs_add_fs(struct proc_dir_entry **dir, acpi_sbs_add_fs(struct proc_dir_entry **dir,
struct proc_dir_entry *parent_dir, struct proc_dir_entry *parent_dir,
char *dir_name, char *dir_name,
struct file_operations *info_fops, const struct file_operations *info_fops,
struct file_operations *state_fops, const struct file_operations *state_fops,
struct file_operations *alarm_fops, void *data) const struct file_operations *alarm_fops, void *data)
{ {
if (!*dir) { if (!*dir) {
*dir = proc_mkdir(dir_name, parent_dir); *dir = proc_mkdir(dir_name, parent_dir);
...@@ -682,7 +682,7 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) ...@@ -682,7 +682,7 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); return single_open(file, acpi_battery_read_alarm, PDE(inode)->data);
} }
static struct file_operations acpi_battery_info_fops = { static const struct file_operations acpi_battery_info_fops = {
.open = acpi_battery_info_open_fs, .open = acpi_battery_info_open_fs,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
...@@ -690,7 +690,7 @@ static struct file_operations acpi_battery_info_fops = { ...@@ -690,7 +690,7 @@ static struct file_operations acpi_battery_info_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static struct file_operations acpi_battery_state_fops = { static const struct file_operations acpi_battery_state_fops = {
.open = acpi_battery_state_open_fs, .open = acpi_battery_state_open_fs,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
...@@ -698,7 +698,7 @@ static struct file_operations acpi_battery_state_fops = { ...@@ -698,7 +698,7 @@ static struct file_operations acpi_battery_state_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static struct file_operations acpi_battery_alarm_fops = { static const struct file_operations acpi_battery_alarm_fops = {
.open = acpi_battery_alarm_open_fs, .open = acpi_battery_alarm_open_fs,
.read = seq_read, .read = seq_read,
.write = acpi_battery_write_alarm, .write = acpi_battery_write_alarm,
...@@ -730,7 +730,7 @@ static int acpi_ac_state_open_fs(struct inode *inode, struct file *file) ...@@ -730,7 +730,7 @@ static int acpi_ac_state_open_fs(struct inode *inode, struct file *file)
return single_open(file, acpi_ac_read_state, PDE(inode)->data); return single_open(file, acpi_ac_read_state, PDE(inode)->data);
} }
static struct file_operations acpi_ac_state_fops = { static const struct file_operations acpi_ac_state_fops = {
.open = acpi_ac_state_open_fs, .open = acpi_ac_state_open_fs,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
......
...@@ -201,7 +201,7 @@ struct acpi_video_device { ...@@ -201,7 +201,7 @@ struct acpi_video_device {
/* bus */ /* bus */
static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file);
static struct file_operations acpi_video_bus_info_fops = { static const struct file_operations acpi_video_bus_info_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_bus_info_open_fs, .open = acpi_video_bus_info_open_fs,
.read = seq_read, .read = seq_read,
...@@ -210,7 +210,7 @@ static struct file_operations acpi_video_bus_info_fops = { ...@@ -210,7 +210,7 @@ static struct file_operations acpi_video_bus_info_fops = {
}; };
static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file); static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file);
static struct file_operations acpi_video_bus_ROM_fops = { static const struct file_operations acpi_video_bus_ROM_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_bus_ROM_open_fs, .open = acpi_video_bus_ROM_open_fs,
.read = seq_read, .read = seq_read,
...@@ -220,7 +220,7 @@ static struct file_operations acpi_video_bus_ROM_fops = { ...@@ -220,7 +220,7 @@ static struct file_operations acpi_video_bus_ROM_fops = {
static int acpi_video_bus_POST_info_open_fs(struct inode *inode, static int acpi_video_bus_POST_info_open_fs(struct inode *inode,
struct file *file); struct file *file);
static struct file_operations acpi_video_bus_POST_info_fops = { static const struct file_operations acpi_video_bus_POST_info_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_bus_POST_info_open_fs, .open = acpi_video_bus_POST_info_open_fs,
.read = seq_read, .read = seq_read,
...@@ -229,19 +229,25 @@ static struct file_operations acpi_video_bus_POST_info_fops = { ...@@ -229,19 +229,25 @@ static struct file_operations acpi_video_bus_POST_info_fops = {
}; };
static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file); static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file);
static struct file_operations acpi_video_bus_POST_fops = { static ssize_t acpi_video_bus_write_POST(struct file *file,
const char __user *buffer, size_t count, loff_t *data);
static const struct file_operations acpi_video_bus_POST_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_bus_POST_open_fs, .open = acpi_video_bus_POST_open_fs,
.read = seq_read, .read = seq_read,
.write = acpi_video_bus_write_POST,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
}; };
static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file); static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file);
static struct file_operations acpi_video_bus_DOS_fops = { static ssize_t acpi_video_bus_write_DOS(struct file *file,
const char __user *buffer, size_t count, loff_t *data);
static const struct file_operations acpi_video_bus_DOS_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_bus_DOS_open_fs, .open = acpi_video_bus_DOS_open_fs,
.read = seq_read, .read = seq_read,
.write = acpi_video_bus_write_DOS,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
}; };
...@@ -249,7 +255,7 @@ static struct file_operations acpi_video_bus_DOS_fops = { ...@@ -249,7 +255,7 @@ static struct file_operations acpi_video_bus_DOS_fops = {
/* device */ /* device */
static int acpi_video_device_info_open_fs(struct inode *inode, static int acpi_video_device_info_open_fs(struct inode *inode,
struct file *file); struct file *file);
static struct file_operations acpi_video_device_info_fops = { static const struct file_operations acpi_video_device_info_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_device_info_open_fs, .open = acpi_video_device_info_open_fs,
.read = seq_read, .read = seq_read,
...@@ -259,27 +265,33 @@ static struct file_operations acpi_video_device_info_fops = { ...@@ -259,27 +265,33 @@ static struct file_operations acpi_video_device_info_fops = {
static int acpi_video_device_state_open_fs(struct inode *inode, static int acpi_video_device_state_open_fs(struct inode *inode,
struct file *file); struct file *file);
static struct file_operations acpi_video_device_state_fops = { static ssize_t acpi_video_device_write_state(struct file *file,
const char __user *buffer, size_t count, loff_t *data);
static const struct file_operations acpi_video_device_state_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_device_state_open_fs, .open = acpi_video_device_state_open_fs,
.read = seq_read, .read = seq_read,
.write = acpi_video_device_write_state,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
}; };
static int acpi_video_device_brightness_open_fs(struct inode *inode, static int acpi_video_device_brightness_open_fs(struct inode *inode,
struct file *file); struct file *file);
static ssize_t acpi_video_device_write_brightness(struct file *file,
const char __user *buffer, size_t count, loff_t *data);
static struct file_operations acpi_video_device_brightness_fops = { static struct file_operations acpi_video_device_brightness_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_device_brightness_open_fs, .open = acpi_video_device_brightness_open_fs,
.read = seq_read, .read = seq_read,
.write = acpi_video_device_write_brightness,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
}; };
static int acpi_video_device_EDID_open_fs(struct inode *inode, static int acpi_video_device_EDID_open_fs(struct inode *inode,
struct file *file); struct file *file);
static struct file_operations acpi_video_device_EDID_fops = { static const struct file_operations acpi_video_device_EDID_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = acpi_video_device_EDID_open_fs, .open = acpi_video_device_EDID_open_fs,
.read = seq_read, .read = seq_read,
...@@ -287,7 +299,7 @@ static struct file_operations acpi_video_device_EDID_fops = { ...@@ -287,7 +299,7 @@ static struct file_operations acpi_video_device_EDID_fops = {
.release = single_release, .release = single_release,
}; };
static char device_decode[][30] = { static const char device_decode[][30] = {
"motherboard VGA device", "motherboard VGA device",
"PCI VGA device", "PCI VGA device",
"AGP VGA device", "AGP VGA device",
...@@ -1253,7 +1265,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device) ...@@ -1253,7 +1265,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
goto err_remove_dir; goto err_remove_dir;
/* 'state' [R/W] */ /* 'state' [R/W] */
acpi_video_device_state_fops.write = acpi_video_device_write_state;
entry = proc_create_data("state", S_IFREG | S_IRUGO | S_IWUSR, entry = proc_create_data("state", S_IFREG | S_IRUGO | S_IWUSR,
device_dir, device_dir,
&acpi_video_device_state_fops, &acpi_video_device_state_fops,
...@@ -1262,8 +1273,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device) ...@@ -1262,8 +1273,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
goto err_remove_info; goto err_remove_info;
/* 'brightness' [R/W] */ /* 'brightness' [R/W] */
acpi_video_device_brightness_fops.write =
acpi_video_device_write_brightness;
entry = proc_create_data("brightness", S_IFREG | S_IRUGO | S_IWUSR, entry = proc_create_data("brightness", S_IFREG | S_IRUGO | S_IWUSR,
device_dir, device_dir,
&acpi_video_device_brightness_fops, &acpi_video_device_brightness_fops,
...@@ -1546,7 +1555,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) ...@@ -1546,7 +1555,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
goto err_remove_rom; goto err_remove_rom;
/* 'POST' [R/W] */ /* 'POST' [R/W] */
acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
entry = proc_create_data("POST", S_IFREG | S_IRUGO | S_IWUSR, entry = proc_create_data("POST", S_IFREG | S_IRUGO | S_IWUSR,
device_dir, device_dir,
&acpi_video_bus_POST_fops, &acpi_video_bus_POST_fops,
...@@ -1555,7 +1563,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) ...@@ -1555,7 +1563,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
goto err_remove_post_info; goto err_remove_post_info;
/* 'DOS' [R/W] */ /* 'DOS' [R/W] */
acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
entry = proc_create_data("DOS", S_IFREG | S_IRUGO | S_IWUSR, entry = proc_create_data("DOS", S_IFREG | S_IRUGO | S_IWUSR,
device_dir, device_dir,
&acpi_video_bus_DOS_fops, &acpi_video_bus_DOS_fops,
......
...@@ -322,7 +322,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) ...@@ -322,7 +322,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
int acpi_processor_tstate_has_changed(struct acpi_processor *pr); int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
int acpi_processor_get_throttling_info(struct acpi_processor *pr); int acpi_processor_get_throttling_info(struct acpi_processor *pr);
extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state); extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
extern struct file_operations acpi_processor_throttling_fops; extern const struct file_operations acpi_processor_throttling_fops;
extern void acpi_processor_throttling_init(void); extern void acpi_processor_throttling_init(void);
/* in processor_idle.c */ /* in processor_idle.c */
int acpi_processor_power_init(struct acpi_processor *pr, int acpi_processor_power_init(struct acpi_processor *pr,
...@@ -336,7 +336,7 @@ extern struct cpuidle_driver acpi_idle_driver; ...@@ -336,7 +336,7 @@ extern struct cpuidle_driver acpi_idle_driver;
/* in processor_thermal.c */ /* in processor_thermal.c */
int acpi_processor_get_limit_info(struct acpi_processor *pr); int acpi_processor_get_limit_info(struct acpi_processor *pr);
extern struct file_operations acpi_processor_limit_fops; extern const struct file_operations acpi_processor_limit_fops;
extern struct thermal_cooling_device_ops processor_cooling_ops; extern struct thermal_cooling_device_ops processor_cooling_ops;
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
void acpi_thermal_cpufreq_init(void); void acpi_thermal_cpufreq_init(void);
......
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