diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-12 22:12:58 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-18 23:22:02 -0500 |
commit | 33f6e7940691b1c92b276148c48a9551ac07f11d (patch) | |
tree | a540957f2093ad10c84f52c3c26e1fd5f25d01c2 | |
parent | b819a9bfc7ae5a1ab5bab18c7e0dbe40bf2289a9 (diff) |
[POWERPC] Convert media-bay.c to use the kthread API
We aren't supposed to use kernel_thread directly in drivers any more,
and in fact using kthread_run is a bit simpler.
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | drivers/macintosh/mediabay.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 48d647abea46..192bef5c20b3 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/stddef.h> | 20 | #include <linux/stddef.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/ide.h> | 22 | #include <linux/ide.h> |
23 | #include <linux/kthread.h> | ||
23 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
24 | #include <asm/pgtable.h> | 25 | #include <asm/pgtable.h> |
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
@@ -35,7 +36,6 @@ | |||
35 | 36 | ||
36 | 37 | ||
37 | #define MB_DEBUG | 38 | #define MB_DEBUG |
38 | #define MB_IGNORE_SIGNALS | ||
39 | 39 | ||
40 | #ifdef MB_DEBUG | 40 | #ifdef MB_DEBUG |
41 | #define MBDBG(fmt, arg...) printk(KERN_INFO fmt , ## arg) | 41 | #define MBDBG(fmt, arg...) printk(KERN_INFO fmt , ## arg) |
@@ -622,12 +622,7 @@ static int media_bay_task(void *x) | |||
622 | { | 622 | { |
623 | int i; | 623 | int i; |
624 | 624 | ||
625 | strcpy(current->comm, "media-bay"); | 625 | while (!kthread_should_stop()) { |
626 | #ifdef MB_IGNORE_SIGNALS | ||
627 | sigfillset(¤t->blocked); | ||
628 | #endif | ||
629 | |||
630 | for (;;) { | ||
631 | for (i = 0; i < media_bay_count; ++i) { | 626 | for (i = 0; i < media_bay_count; ++i) { |
632 | down(&media_bays[i].lock); | 627 | down(&media_bays[i].lock); |
633 | if (!media_bays[i].sleeping) | 628 | if (!media_bays[i].sleeping) |
@@ -636,9 +631,8 @@ static int media_bay_task(void *x) | |||
636 | } | 631 | } |
637 | 632 | ||
638 | msleep_interruptible(MB_POLL_DELAY); | 633 | msleep_interruptible(MB_POLL_DELAY); |
639 | if (signal_pending(current)) | ||
640 | return 0; | ||
641 | } | 634 | } |
635 | return 0; | ||
642 | } | 636 | } |
643 | 637 | ||
644 | static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match) | 638 | static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match) |
@@ -699,7 +693,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de | |||
699 | 693 | ||
700 | /* Startup kernel thread */ | 694 | /* Startup kernel thread */ |
701 | if (i == 0) | 695 | if (i == 0) |
702 | kernel_thread(media_bay_task, NULL, CLONE_KERNEL); | 696 | kthread_run(media_bay_task, NULL, "media-bay"); |
703 | 697 | ||
704 | return 0; | 698 | return 0; |
705 | 699 | ||