Skip to content

Commit

Permalink
[POWERPC] Convert media-bay.c to use the kthread API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mackerras committed Dec 19, 2007
1 parent b819a9b commit 33f6e79
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/macintosh/mediabay.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/stddef.h>
#include <linux/init.h>
#include <linux/ide.h>
#include <linux/kthread.h>
#include <asm/prom.h>
#include <asm/pgtable.h>
#include <asm/io.h>
Expand All @@ -35,7 +36,6 @@


#define MB_DEBUG
#define MB_IGNORE_SIGNALS

#ifdef MB_DEBUG
#define MBDBG(fmt, arg...) printk(KERN_INFO fmt , ## arg)
Expand Down Expand Up @@ -622,12 +622,7 @@ static int media_bay_task(void *x)
{
int i;

strcpy(current->comm, "media-bay");
#ifdef MB_IGNORE_SIGNALS
sigfillset(&current->blocked);
#endif

for (;;) {
while (!kthread_should_stop()) {
for (i = 0; i < media_bay_count; ++i) {
down(&media_bays[i].lock);
if (!media_bays[i].sleeping)
Expand All @@ -636,9 +631,8 @@ static int media_bay_task(void *x)
}

msleep_interruptible(MB_POLL_DELAY);
if (signal_pending(current))
return 0;
}
return 0;
}

static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match)
Expand Down Expand Up @@ -699,7 +693,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de

/* Startup kernel thread */
if (i == 0)
kernel_thread(media_bay_task, NULL, CLONE_KERNEL);
kthread_run(media_bay_task, NULL, "media-bay");

return 0;

Expand Down

0 comments on commit 33f6e79

Please sign in to comment.