diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 14:40:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 14:40:04 -0500 |
commit | 574009c1a895aeeb85eaab29c235d75852b09eb8 (patch) | |
tree | 350208723aea3fa62927e5fed6c07567cee9f930 /arch/mips/kernel/rtlx.c | |
parent | a727fea99bf4b2addcd64c596735148117a7b37f (diff) | |
parent | e692eb30ffc2b99e62f766f9958f46dfdc1013cc (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] signal: do not inline handle_signal()
[MIPS] signal: do not use save_static_function() anymore
[MIPS] signal32: no need to save c0_status register in setup_sigcontext32()
[MIPS] signal32: reduce {setup,restore}_sigcontext32 sizes
[MIPS] signal: factorize debug code
[MIPS] signal: test return value of install_sigtramp()
[MIPS] signal32: remove duplicate code
[MIPS] signal: clean up sigframe structure
[MIPS] signal: do not inline functions in signal-common.h
[MIPS] signals: reduce {setup,restore}_sigcontext sizes
[MIPS] Fix warning in get_user when fetching pointer object from userspace.
[MIPS] Fix eth2 platform device id for jaguar_atx and ocelot_3 platforms
[MIPS] JMR3927 and RBTX49x7 support little endian
[MIPS] RBTX49x7: declare prom_getcmdline()
[MIPS] RTLX: Sprinkle device model code into code to make udev happier.
[MIPS] VPE: Sprinkle device model code into code to make udev happier.
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
-rw-r--r-- | arch/mips/kernel/rtlx.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 8610f4a925e9..f29e93c6ccfc 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/device.h> | ||
20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
22 | #include <linux/fs.h> | 23 | #include <linux/fs.h> |
@@ -34,6 +35,7 @@ | |||
34 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
35 | #include <linux/wait.h> | 36 | #include <linux/wait.h> |
36 | #include <asm/mipsmtregs.h> | 37 | #include <asm/mipsmtregs.h> |
38 | #include <asm/mips_mt.h> | ||
37 | #include <asm/cacheflush.h> | 39 | #include <asm/cacheflush.h> |
38 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
39 | #include <asm/cpu.h> | 41 | #include <asm/cpu.h> |
@@ -498,7 +500,8 @@ static char register_chrdev_failed[] __initdata = | |||
498 | 500 | ||
499 | static int rtlx_module_init(void) | 501 | static int rtlx_module_init(void) |
500 | { | 502 | { |
501 | int i; | 503 | struct device *dev; |
504 | int i, err; | ||
502 | 505 | ||
503 | major = register_chrdev(0, module_name, &rtlx_fops); | 506 | major = register_chrdev(0, module_name, &rtlx_fops); |
504 | if (major < 0) { | 507 | if (major < 0) { |
@@ -511,6 +514,13 @@ static int rtlx_module_init(void) | |||
511 | init_waitqueue_head(&channel_wqs[i].rt_queue); | 514 | init_waitqueue_head(&channel_wqs[i].rt_queue); |
512 | init_waitqueue_head(&channel_wqs[i].lx_queue); | 515 | init_waitqueue_head(&channel_wqs[i].lx_queue); |
513 | channel_wqs[i].in_open = 0; | 516 | channel_wqs[i].in_open = 0; |
517 | |||
518 | dev = device_create(mt_class, NULL, MKDEV(major, i), | ||
519 | "%s%d", module_name, i); | ||
520 | if (IS_ERR(dev)) { | ||
521 | err = PTR_ERR(dev); | ||
522 | goto out_chrdev; | ||
523 | } | ||
514 | } | 524 | } |
515 | 525 | ||
516 | /* set up notifiers */ | 526 | /* set up notifiers */ |
@@ -525,10 +535,21 @@ static int rtlx_module_init(void) | |||
525 | setup_irq(rtlx_irq_num, &rtlx_irq); | 535 | setup_irq(rtlx_irq_num, &rtlx_irq); |
526 | 536 | ||
527 | return 0; | 537 | return 0; |
538 | |||
539 | out_chrdev: | ||
540 | for (i = 0; i < RTLX_CHANNELS; i++) | ||
541 | device_destroy(mt_class, MKDEV(major, i)); | ||
542 | |||
543 | return err; | ||
528 | } | 544 | } |
529 | 545 | ||
530 | static void __exit rtlx_module_exit(void) | 546 | static void __exit rtlx_module_exit(void) |
531 | { | 547 | { |
548 | int i; | ||
549 | |||
550 | for (i = 0; i < RTLX_CHANNELS; i++) | ||
551 | device_destroy(mt_class, MKDEV(major, i)); | ||
552 | |||
532 | unregister_chrdev(major, module_name); | 553 | unregister_chrdev(major, module_name); |
533 | } | 554 | } |
534 | 555 | ||