diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/eeprom/max6875.c | 29 | ||||
-rw-r--r-- | drivers/misc/hpilo.c | 1 | ||||
-rw-r--r-- | drivers/misc/ibmasm/command.c | 1 | ||||
-rw-r--r-- | drivers/misc/ibmasm/event.c | 1 | ||||
-rw-r--r-- | drivers/misc/ibmasm/r_heartbeat.c | 1 | ||||
-rw-r--r-- | drivers/misc/phantom.c | 3 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grufile.c | 5 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/gruprocfs.c | 13 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grutables.h | 2 |
9 files changed, 21 insertions, 35 deletions
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index 3c0c58eed347..5a6b2bce8ad5 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c | |||
@@ -33,12 +33,6 @@ | |||
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | 35 | ||
36 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ | ||
37 | static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; | ||
38 | |||
39 | /* Insmod parameters */ | ||
40 | I2C_CLIENT_INSMOD_1(max6875); | ||
41 | |||
42 | /* The MAX6875 can only read/write 16 bytes at a time */ | 36 | /* The MAX6875 can only read/write 16 bytes at a time */ |
43 | #define SLICE_SIZE 16 | 37 | #define SLICE_SIZE 16 |
44 | #define SLICE_BITS 4 | 38 | #define SLICE_BITS 4 |
@@ -146,31 +140,21 @@ static struct bin_attribute user_eeprom_attr = { | |||
146 | .read = max6875_read, | 140 | .read = max6875_read, |
147 | }; | 141 | }; |
148 | 142 | ||
149 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 143 | static int max6875_probe(struct i2c_client *client, |
150 | static int max6875_detect(struct i2c_client *client, int kind, | 144 | const struct i2c_device_id *id) |
151 | struct i2c_board_info *info) | ||
152 | { | 145 | { |
153 | struct i2c_adapter *adapter = client->adapter; | 146 | struct i2c_adapter *adapter = client->adapter; |
147 | struct max6875_data *data; | ||
148 | int err; | ||
154 | 149 | ||
155 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | 150 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
156 | | I2C_FUNC_SMBUS_READ_BYTE)) | 151 | | I2C_FUNC_SMBUS_READ_BYTE)) |
157 | return -ENODEV; | 152 | return -ENODEV; |
158 | 153 | ||
159 | /* Only check even addresses */ | 154 | /* Only bind to even addresses */ |
160 | if (client->addr & 1) | 155 | if (client->addr & 1) |
161 | return -ENODEV; | 156 | return -ENODEV; |
162 | 157 | ||
163 | strlcpy(info->type, "max6875", I2C_NAME_SIZE); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | static int max6875_probe(struct i2c_client *client, | ||
169 | const struct i2c_device_id *id) | ||
170 | { | ||
171 | struct max6875_data *data; | ||
172 | int err; | ||
173 | |||
174 | if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) | 158 | if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) |
175 | return -ENOMEM; | 159 | return -ENOMEM; |
176 | 160 | ||
@@ -222,9 +206,6 @@ static struct i2c_driver max6875_driver = { | |||
222 | .probe = max6875_probe, | 206 | .probe = max6875_probe, |
223 | .remove = max6875_remove, | 207 | .remove = max6875_remove, |
224 | .id_table = max6875_id, | 208 | .id_table = max6875_id, |
225 | |||
226 | .detect = max6875_detect, | ||
227 | .address_data = &addr_data, | ||
228 | }; | 209 | }; |
229 | 210 | ||
230 | static int __init max6875_init(void) | 211 | static int __init max6875_init(void) |
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 1ad27c6abcca..a92a3a742b43 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/file.h> | 19 | #include <linux/file.h> |
20 | #include <linux/cdev.h> | 20 | #include <linux/cdev.h> |
21 | #include <linux/sched.h> | ||
21 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
22 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
23 | #include <linux/uaccess.h> | 24 | #include <linux/uaccess.h> |
diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c index 276d3fb68094..e2031739aa29 100644 --- a/drivers/misc/ibmasm/command.c +++ b/drivers/misc/ibmasm/command.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/sched.h> | ||
25 | #include "ibmasm.h" | 26 | #include "ibmasm.h" |
26 | #include "lowlevel.h" | 27 | #include "lowlevel.h" |
27 | 28 | ||
diff --git a/drivers/misc/ibmasm/event.c b/drivers/misc/ibmasm/event.c index 68a0a5b94795..572d41ffc186 100644 --- a/drivers/misc/ibmasm/event.c +++ b/drivers/misc/ibmasm/event.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/sched.h> | ||
25 | #include "ibmasm.h" | 26 | #include "ibmasm.h" |
26 | #include "lowlevel.h" | 27 | #include "lowlevel.h" |
27 | 28 | ||
diff --git a/drivers/misc/ibmasm/r_heartbeat.c b/drivers/misc/ibmasm/r_heartbeat.c index bec9e2c44bef..2de487ac788c 100644 --- a/drivers/misc/ibmasm/r_heartbeat.c +++ b/drivers/misc/ibmasm/r_heartbeat.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/sched.h> | ||
23 | #include "ibmasm.h" | 24 | #include "ibmasm.h" |
24 | #include "dot_command.h" | 25 | #include "dot_command.h" |
25 | 26 | ||
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index fa57b67593ae..04c27266f567 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/cdev.h> | 23 | #include <linux/cdev.h> |
24 | #include <linux/phantom.h> | 24 | #include <linux/phantom.h> |
25 | #include <linux/sched.h> | ||
25 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
26 | 27 | ||
27 | #include <asm/atomic.h> | 28 | #include <asm/atomic.h> |
@@ -271,7 +272,7 @@ static unsigned int phantom_poll(struct file *file, poll_table *wait) | |||
271 | return mask; | 272 | return mask; |
272 | } | 273 | } |
273 | 274 | ||
274 | static struct file_operations phantom_file_ops = { | 275 | static const struct file_operations phantom_file_ops = { |
275 | .open = phantom_open, | 276 | .open = phantom_open, |
276 | .release = phantom_release, | 277 | .release = phantom_release, |
277 | .unlocked_ioctl = phantom_ioctl, | 278 | .unlocked_ioctl = phantom_ioctl, |
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index aed609832bc2..41c8fe2a928c 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -53,7 +53,6 @@ struct gru_stats_s gru_stats; | |||
53 | /* Guaranteed user available resources on each node */ | 53 | /* Guaranteed user available resources on each node */ |
54 | static int max_user_cbrs, max_user_dsr_bytes; | 54 | static int max_user_cbrs, max_user_dsr_bytes; |
55 | 55 | ||
56 | static struct file_operations gru_fops; | ||
57 | static struct miscdevice gru_miscdev; | 56 | static struct miscdevice gru_miscdev; |
58 | 57 | ||
59 | 58 | ||
@@ -426,7 +425,7 @@ static void __exit gru_exit(void) | |||
426 | gru_proc_exit(); | 425 | gru_proc_exit(); |
427 | } | 426 | } |
428 | 427 | ||
429 | static struct file_operations gru_fops = { | 428 | static const struct file_operations gru_fops = { |
430 | .owner = THIS_MODULE, | 429 | .owner = THIS_MODULE, |
431 | .unlocked_ioctl = gru_file_unlocked_ioctl, | 430 | .unlocked_ioctl = gru_file_unlocked_ioctl, |
432 | .mmap = gru_file_mmap, | 431 | .mmap = gru_file_mmap, |
@@ -438,7 +437,7 @@ static struct miscdevice gru_miscdev = { | |||
438 | .fops = &gru_fops, | 437 | .fops = &gru_fops, |
439 | }; | 438 | }; |
440 | 439 | ||
441 | struct vm_operations_struct gru_vm_ops = { | 440 | const struct vm_operations_struct gru_vm_ops = { |
442 | .close = gru_vma_close, | 441 | .close = gru_vma_close, |
443 | .fault = gru_fault, | 442 | .fault = gru_fault, |
444 | }; | 443 | }; |
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c index ccd4408a26c7..3f2375c5ba5b 100644 --- a/drivers/misc/sgi-gru/gruprocfs.c +++ b/drivers/misc/sgi-gru/gruprocfs.c | |||
@@ -161,14 +161,15 @@ static int options_show(struct seq_file *s, void *p) | |||
161 | static ssize_t options_write(struct file *file, const char __user *userbuf, | 161 | static ssize_t options_write(struct file *file, const char __user *userbuf, |
162 | size_t count, loff_t *data) | 162 | size_t count, loff_t *data) |
163 | { | 163 | { |
164 | unsigned long val; | 164 | char buf[20]; |
165 | char buf[80]; | ||
166 | 165 | ||
167 | if (strncpy_from_user(buf, userbuf, sizeof(buf) - 1) < 0) | 166 | if (count >= sizeof(buf)) |
167 | return -EINVAL; | ||
168 | if (copy_from_user(buf, userbuf, count)) | ||
168 | return -EFAULT; | 169 | return -EFAULT; |
169 | buf[count - 1] = '\0'; | 170 | buf[count] = '\0'; |
170 | if (!strict_strtoul(buf, 10, &val)) | 171 | if (strict_strtoul(buf, 0, &gru_options)) |
171 | gru_options = val; | 172 | return -EINVAL; |
172 | 173 | ||
173 | return count; | 174 | return count; |
174 | } | 175 | } |
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h index 34ab3d453919..46990bcfa536 100644 --- a/drivers/misc/sgi-gru/grutables.h +++ b/drivers/misc/sgi-gru/grutables.h | |||
@@ -624,7 +624,7 @@ static inline int is_kernel_context(struct gru_thread_state *gts) | |||
624 | */ | 624 | */ |
625 | struct gru_unload_context_req; | 625 | struct gru_unload_context_req; |
626 | 626 | ||
627 | extern struct vm_operations_struct gru_vm_ops; | 627 | extern const struct vm_operations_struct gru_vm_ops; |
628 | extern struct device *grudev; | 628 | extern struct device *grudev; |
629 | 629 | ||
630 | extern struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma, | 630 | extern struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma, |