diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/sbus/char | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r-- | drivers/sbus/char/bbc_i2c.c | 9 | ||||
-rw-r--r-- | drivers/sbus/char/display7seg.c | 10 | ||||
-rw-r--r-- | drivers/sbus/char/envctrl.c | 10 | ||||
-rw-r--r-- | drivers/sbus/char/flash.c | 9 | ||||
-rw-r--r-- | drivers/sbus/char/jsflash.c | 30 | ||||
-rw-r--r-- | drivers/sbus/char/max1617.h | 2 | ||||
-rw-r--r-- | drivers/sbus/char/uctrl.c | 9 |
7 files changed, 39 insertions, 40 deletions
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 614a5e114a19..5f94d22c491e 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c | |||
@@ -361,8 +361,7 @@ fail: | |||
361 | extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); | 361 | extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); |
362 | extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); | 362 | extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); |
363 | 363 | ||
364 | static int __devinit bbc_i2c_probe(struct platform_device *op, | 364 | static int __devinit bbc_i2c_probe(struct platform_device *op) |
365 | const struct of_device_id *match) | ||
366 | { | 365 | { |
367 | struct bbc_i2c_bus *bp; | 366 | struct bbc_i2c_bus *bp; |
368 | int err, index = 0; | 367 | int err, index = 0; |
@@ -413,7 +412,7 @@ static const struct of_device_id bbc_i2c_match[] = { | |||
413 | }; | 412 | }; |
414 | MODULE_DEVICE_TABLE(of, bbc_i2c_match); | 413 | MODULE_DEVICE_TABLE(of, bbc_i2c_match); |
415 | 414 | ||
416 | static struct of_platform_driver bbc_i2c_driver = { | 415 | static struct platform_driver bbc_i2c_driver = { |
417 | .driver = { | 416 | .driver = { |
418 | .name = "bbc_i2c", | 417 | .name = "bbc_i2c", |
419 | .owner = THIS_MODULE, | 418 | .owner = THIS_MODULE, |
@@ -425,12 +424,12 @@ static struct of_platform_driver bbc_i2c_driver = { | |||
425 | 424 | ||
426 | static int __init bbc_i2c_init(void) | 425 | static int __init bbc_i2c_init(void) |
427 | { | 426 | { |
428 | return of_register_platform_driver(&bbc_i2c_driver); | 427 | return platform_driver_register(&bbc_i2c_driver); |
429 | } | 428 | } |
430 | 429 | ||
431 | static void __exit bbc_i2c_exit(void) | 430 | static void __exit bbc_i2c_exit(void) |
432 | { | 431 | { |
433 | of_unregister_platform_driver(&bbc_i2c_driver); | 432 | platform_driver_unregister(&bbc_i2c_driver); |
434 | } | 433 | } |
435 | 434 | ||
436 | module_init(bbc_i2c_init); | 435 | module_init(bbc_i2c_init); |
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index 1690e53fb84a..740da4465447 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c | |||
@@ -162,6 +162,7 @@ static const struct file_operations d7s_fops = { | |||
162 | .compat_ioctl = d7s_ioctl, | 162 | .compat_ioctl = d7s_ioctl, |
163 | .open = d7s_open, | 163 | .open = d7s_open, |
164 | .release = d7s_release, | 164 | .release = d7s_release, |
165 | .llseek = noop_llseek, | ||
165 | }; | 166 | }; |
166 | 167 | ||
167 | static struct miscdevice d7s_miscdev = { | 168 | static struct miscdevice d7s_miscdev = { |
@@ -170,8 +171,7 @@ static struct miscdevice d7s_miscdev = { | |||
170 | .fops = &d7s_fops | 171 | .fops = &d7s_fops |
171 | }; | 172 | }; |
172 | 173 | ||
173 | static int __devinit d7s_probe(struct platform_device *op, | 174 | static int __devinit d7s_probe(struct platform_device *op) |
174 | const struct of_device_id *match) | ||
175 | { | 175 | { |
176 | struct device_node *opts; | 176 | struct device_node *opts; |
177 | int err = -EINVAL; | 177 | int err = -EINVAL; |
@@ -265,7 +265,7 @@ static const struct of_device_id d7s_match[] = { | |||
265 | }; | 265 | }; |
266 | MODULE_DEVICE_TABLE(of, d7s_match); | 266 | MODULE_DEVICE_TABLE(of, d7s_match); |
267 | 267 | ||
268 | static struct of_platform_driver d7s_driver = { | 268 | static struct platform_driver d7s_driver = { |
269 | .driver = { | 269 | .driver = { |
270 | .name = DRIVER_NAME, | 270 | .name = DRIVER_NAME, |
271 | .owner = THIS_MODULE, | 271 | .owner = THIS_MODULE, |
@@ -277,12 +277,12 @@ static struct of_platform_driver d7s_driver = { | |||
277 | 277 | ||
278 | static int __init d7s_init(void) | 278 | static int __init d7s_init(void) |
279 | { | 279 | { |
280 | return of_register_platform_driver(&d7s_driver); | 280 | return platform_driver_register(&d7s_driver); |
281 | } | 281 | } |
282 | 282 | ||
283 | static void __exit d7s_exit(void) | 283 | static void __exit d7s_exit(void) |
284 | { | 284 | { |
285 | of_unregister_platform_driver(&d7s_driver); | 285 | platform_driver_unregister(&d7s_driver); |
286 | } | 286 | } |
287 | 287 | ||
288 | module_init(d7s_init); | 288 | module_init(d7s_init); |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 078e5f4520ef..be7b4e56154f 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -720,6 +720,7 @@ static const struct file_operations envctrl_fops = { | |||
720 | #endif | 720 | #endif |
721 | .open = envctrl_open, | 721 | .open = envctrl_open, |
722 | .release = envctrl_release, | 722 | .release = envctrl_release, |
723 | .llseek = noop_llseek, | ||
723 | }; | 724 | }; |
724 | 725 | ||
725 | static struct miscdevice envctrl_dev = { | 726 | static struct miscdevice envctrl_dev = { |
@@ -1027,8 +1028,7 @@ static int kenvctrld(void *__unused) | |||
1027 | return 0; | 1028 | return 0; |
1028 | } | 1029 | } |
1029 | 1030 | ||
1030 | static int __devinit envctrl_probe(struct platform_device *op, | 1031 | static int __devinit envctrl_probe(struct platform_device *op) |
1031 | const struct of_device_id *match) | ||
1032 | { | 1032 | { |
1033 | struct device_node *dp; | 1033 | struct device_node *dp; |
1034 | int index, err; | 1034 | int index, err; |
@@ -1128,7 +1128,7 @@ static const struct of_device_id envctrl_match[] = { | |||
1128 | }; | 1128 | }; |
1129 | MODULE_DEVICE_TABLE(of, envctrl_match); | 1129 | MODULE_DEVICE_TABLE(of, envctrl_match); |
1130 | 1130 | ||
1131 | static struct of_platform_driver envctrl_driver = { | 1131 | static struct platform_driver envctrl_driver = { |
1132 | .driver = { | 1132 | .driver = { |
1133 | .name = DRIVER_NAME, | 1133 | .name = DRIVER_NAME, |
1134 | .owner = THIS_MODULE, | 1134 | .owner = THIS_MODULE, |
@@ -1140,12 +1140,12 @@ static struct of_platform_driver envctrl_driver = { | |||
1140 | 1140 | ||
1141 | static int __init envctrl_init(void) | 1141 | static int __init envctrl_init(void) |
1142 | { | 1142 | { |
1143 | return of_register_platform_driver(&envctrl_driver); | 1143 | return platform_driver_register(&envctrl_driver); |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | static void __exit envctrl_exit(void) | 1146 | static void __exit envctrl_exit(void) |
1147 | { | 1147 | { |
1148 | of_unregister_platform_driver(&envctrl_driver); | 1148 | platform_driver_unregister(&envctrl_driver); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | module_init(envctrl_init); | 1151 | module_init(envctrl_init); |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 2b4b4b613c48..73dd4e7afaaa 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -160,8 +160,7 @@ static const struct file_operations flash_fops = { | |||
160 | 160 | ||
161 | static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; | 161 | static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; |
162 | 162 | ||
163 | static int __devinit flash_probe(struct platform_device *op, | 163 | static int __devinit flash_probe(struct platform_device *op) |
164 | const struct of_device_id *match) | ||
165 | { | 164 | { |
166 | struct device_node *dp = op->dev.of_node; | 165 | struct device_node *dp = op->dev.of_node; |
167 | struct device_node *parent; | 166 | struct device_node *parent; |
@@ -207,7 +206,7 @@ static const struct of_device_id flash_match[] = { | |||
207 | }; | 206 | }; |
208 | MODULE_DEVICE_TABLE(of, flash_match); | 207 | MODULE_DEVICE_TABLE(of, flash_match); |
209 | 208 | ||
210 | static struct of_platform_driver flash_driver = { | 209 | static struct platform_driver flash_driver = { |
211 | .driver = { | 210 | .driver = { |
212 | .name = "flash", | 211 | .name = "flash", |
213 | .owner = THIS_MODULE, | 212 | .owner = THIS_MODULE, |
@@ -219,12 +218,12 @@ static struct of_platform_driver flash_driver = { | |||
219 | 218 | ||
220 | static int __init flash_init(void) | 219 | static int __init flash_init(void) |
221 | { | 220 | { |
222 | return of_register_platform_driver(&flash_driver); | 221 | return platform_driver_register(&flash_driver); |
223 | } | 222 | } |
224 | 223 | ||
225 | static void __exit flash_cleanup(void) | 224 | static void __exit flash_cleanup(void) |
226 | { | 225 | { |
227 | of_unregister_platform_driver(&flash_driver); | 226 | platform_driver_unregister(&flash_driver); |
228 | } | 227 | } |
229 | 228 | ||
230 | module_init(flash_init); | 229 | module_init(flash_init); |
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 4942050dc5b6..6b4678a7900a 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * TODO: Erase/program both banks of a 8MB SIMM. | 13 | * TODO: Erase/program both banks of a 8MB SIMM. |
14 | * | 14 | * |
15 | * It is anticipated that programming an OS Flash will be a routine | 15 | * It is anticipated that programming an OS Flash will be a routine |
16 | * procedure. In the same time it is exeedingly dangerous because | 16 | * procedure. In the same time it is exceedingly dangerous because |
17 | * a user can program its OBP flash with OS image and effectively | 17 | * a user can program its OBP flash with OS image and effectively |
18 | * kill the machine. | 18 | * kill the machine. |
19 | * | 19 | * |
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/smp_lock.h> | 30 | #include <linux/mutex.h> |
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
@@ -68,6 +68,8 @@ | |||
68 | #define JSF_PART_BITS 2 /* 2 bits of minors to cover JSF_NPART */ | 68 | #define JSF_PART_BITS 2 /* 2 bits of minors to cover JSF_NPART */ |
69 | #define JSF_PART_MASK 0x3 /* 2 bits mask */ | 69 | #define JSF_PART_MASK 0x3 /* 2 bits mask */ |
70 | 70 | ||
71 | static DEFINE_MUTEX(jsf_mutex); | ||
72 | |||
71 | /* | 73 | /* |
72 | * Access functions. | 74 | * Access functions. |
73 | * We could ioremap(), but it's easier this way. | 75 | * We could ioremap(), but it's easier this way. |
@@ -225,7 +227,7 @@ static loff_t jsf_lseek(struct file * file, loff_t offset, int orig) | |||
225 | { | 227 | { |
226 | loff_t ret; | 228 | loff_t ret; |
227 | 229 | ||
228 | lock_kernel(); | 230 | mutex_lock(&jsf_mutex); |
229 | switch (orig) { | 231 | switch (orig) { |
230 | case 0: | 232 | case 0: |
231 | file->f_pos = offset; | 233 | file->f_pos = offset; |
@@ -238,7 +240,7 @@ static loff_t jsf_lseek(struct file * file, loff_t offset, int orig) | |||
238 | default: | 240 | default: |
239 | ret = -EINVAL; | 241 | ret = -EINVAL; |
240 | } | 242 | } |
241 | unlock_kernel(); | 243 | mutex_unlock(&jsf_mutex); |
242 | return ret; | 244 | return ret; |
243 | } | 245 | } |
244 | 246 | ||
@@ -384,18 +386,18 @@ static int jsf_ioctl_program(void __user *arg) | |||
384 | 386 | ||
385 | static long jsf_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | 387 | static long jsf_ioctl(struct file *f, unsigned int cmd, unsigned long arg) |
386 | { | 388 | { |
387 | lock_kernel(); | 389 | mutex_lock(&jsf_mutex); |
388 | int error = -ENOTTY; | 390 | int error = -ENOTTY; |
389 | void __user *argp = (void __user *)arg; | 391 | void __user *argp = (void __user *)arg; |
390 | 392 | ||
391 | if (!capable(CAP_SYS_ADMIN)) { | 393 | if (!capable(CAP_SYS_ADMIN)) { |
392 | unlock_kernel(); | 394 | mutex_unlock(&jsf_mutex); |
393 | return -EPERM; | 395 | return -EPERM; |
394 | } | 396 | } |
395 | switch (cmd) { | 397 | switch (cmd) { |
396 | case JSFLASH_IDENT: | 398 | case JSFLASH_IDENT: |
397 | if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) { | 399 | if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) { |
398 | unlock_kernel(); | 400 | mutex_unlock(&jsf_mutex); |
399 | return -EFAULT; | 401 | return -EFAULT; |
400 | } | 402 | } |
401 | break; | 403 | break; |
@@ -407,7 +409,7 @@ static long jsf_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | |||
407 | break; | 409 | break; |
408 | } | 410 | } |
409 | 411 | ||
410 | unlock_kernel(); | 412 | mutex_unlock(&jsf_mutex); |
411 | return error; | 413 | return error; |
412 | } | 414 | } |
413 | 415 | ||
@@ -418,17 +420,17 @@ static int jsf_mmap(struct file * file, struct vm_area_struct * vma) | |||
418 | 420 | ||
419 | static int jsf_open(struct inode * inode, struct file * filp) | 421 | static int jsf_open(struct inode * inode, struct file * filp) |
420 | { | 422 | { |
421 | lock_kernel(); | 423 | mutex_lock(&jsf_mutex); |
422 | if (jsf0.base == 0) { | 424 | if (jsf0.base == 0) { |
423 | unlock_kernel(); | 425 | mutex_unlock(&jsf_mutex); |
424 | return -ENXIO; | 426 | return -ENXIO; |
425 | } | 427 | } |
426 | if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) { | 428 | if (test_and_set_bit(0, (void *)&jsf0.busy) != 0) { |
427 | unlock_kernel(); | 429 | mutex_unlock(&jsf_mutex); |
428 | return -EBUSY; | 430 | return -EBUSY; |
429 | } | 431 | } |
430 | 432 | ||
431 | unlock_kernel(); | 433 | mutex_unlock(&jsf_mutex); |
432 | return 0; /* XXX What security? */ | 434 | return 0; /* XXX What security? */ |
433 | } | 435 | } |
434 | 436 | ||
@@ -459,13 +461,13 @@ static int jsflash_init(void) | |||
459 | { | 461 | { |
460 | int rc; | 462 | int rc; |
461 | struct jsflash *jsf; | 463 | struct jsflash *jsf; |
462 | int node; | 464 | phandle node; |
463 | char banner[128]; | 465 | char banner[128]; |
464 | struct linux_prom_registers reg0; | 466 | struct linux_prom_registers reg0; |
465 | 467 | ||
466 | node = prom_getchild(prom_root_node); | 468 | node = prom_getchild(prom_root_node); |
467 | node = prom_searchsiblings(node, "flash-memory"); | 469 | node = prom_searchsiblings(node, "flash-memory"); |
468 | if (node != 0 && node != -1) { | 470 | if (node != 0 && (s32)node != -1) { |
469 | if (prom_getproperty(node, "reg", | 471 | if (prom_getproperty(node, "reg", |
470 | (char *)®0, sizeof(reg0)) == -1) { | 472 | (char *)®0, sizeof(reg0)) == -1) { |
471 | printk("jsflash: no \"reg\" property\n"); | 473 | printk("jsflash: no \"reg\" property\n"); |
diff --git a/drivers/sbus/char/max1617.h b/drivers/sbus/char/max1617.h index 0bb09c286cb4..cd30819a0a30 100644 --- a/drivers/sbus/char/max1617.h +++ b/drivers/sbus/char/max1617.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #define MAX1617_CPU_TEMP 0x01 /* Processor die temp in C */ | 6 | #define MAX1617_CPU_TEMP 0x01 /* Processor die temp in C */ |
7 | #define MAX1617_STATUS 0x02 /* Chip status bits */ | 7 | #define MAX1617_STATUS 0x02 /* Chip status bits */ |
8 | 8 | ||
9 | /* Read-only versions of changable registers. */ | 9 | /* Read-only versions of changeable registers. */ |
10 | #define MAX1617_RD_CFG_BYTE 0x03 /* Config register */ | 10 | #define MAX1617_RD_CFG_BYTE 0x03 /* Config register */ |
11 | #define MAX1617_RD_CVRATE_BYTE 0x04 /* Temp conversion rate */ | 11 | #define MAX1617_RD_CVRATE_BYTE 0x04 /* Temp conversion rate */ |
12 | #define MAX1617_RD_AMB_HIGHLIM 0x05 /* Ambient high limit */ | 12 | #define MAX1617_RD_AMB_HIGHLIM 0x05 /* Ambient high limit */ |
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 1b345be5cc02..ebce9639a26a 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c | |||
@@ -348,8 +348,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver) | |||
348 | 348 | ||
349 | } | 349 | } |
350 | 350 | ||
351 | static int __devinit uctrl_probe(struct platform_device *op, | 351 | static int __devinit uctrl_probe(struct platform_device *op) |
352 | const struct of_device_id *match) | ||
353 | { | 352 | { |
354 | struct uctrl_driver *p; | 353 | struct uctrl_driver *p; |
355 | int err = -ENOMEM; | 354 | int err = -ENOMEM; |
@@ -425,7 +424,7 @@ static const struct of_device_id uctrl_match[] = { | |||
425 | }; | 424 | }; |
426 | MODULE_DEVICE_TABLE(of, uctrl_match); | 425 | MODULE_DEVICE_TABLE(of, uctrl_match); |
427 | 426 | ||
428 | static struct of_platform_driver uctrl_driver = { | 427 | static struct platform_driver uctrl_driver = { |
429 | .driver = { | 428 | .driver = { |
430 | .name = "uctrl", | 429 | .name = "uctrl", |
431 | .owner = THIS_MODULE, | 430 | .owner = THIS_MODULE, |
@@ -438,12 +437,12 @@ static struct of_platform_driver uctrl_driver = { | |||
438 | 437 | ||
439 | static int __init uctrl_init(void) | 438 | static int __init uctrl_init(void) |
440 | { | 439 | { |
441 | return of_register_platform_driver(&uctrl_driver); | 440 | return platform_driver_register(&uctrl_driver); |
442 | } | 441 | } |
443 | 442 | ||
444 | static void __exit uctrl_exit(void) | 443 | static void __exit uctrl_exit(void) |
445 | { | 444 | { |
446 | of_unregister_platform_driver(&uctrl_driver); | 445 | platform_driver_unregister(&uctrl_driver); |
447 | } | 446 | } |
448 | 447 | ||
449 | module_init(uctrl_init); | 448 | module_init(uctrl_init); |