From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161219AbXDSHJF (ORCPT ); Thu, 19 Apr 2007 03:09:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161198AbXDSHIf (ORCPT ); Thu, 19 Apr 2007 03:08:35 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:46298 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161217AbXDSHAM (ORCPT ); Thu, 19 Apr 2007 03:00:12 -0400 From: "Eric W. Biederman" To: " Cc: , Oleg Nesterov , Christoph Hellwig , , "Eric W. Biederman" Subject: [PATCH] macintosh/mediabay: Convert to kthread API. Date: Thu, 19 Apr 2007 00:55:45 -0600 Message-Id: <11769657932114-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 1.5.0.rc1.gb60d In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Eric W. Biederman - unquoted This patch modifies the startup of the media_bay_task to use kthread_run and not a combination of kernel_thread, deamonize and sigfillset. In addition since we now always want to ignore signals the MB_IGNORE_SIGNALS define is removed along with the test for signal_pending. The result is slightly simpler code that is more maintainable. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Eric W. Biederman --- drivers/macintosh/mediabay.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index c803d2b..90c853e 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #define MB_DEBUG -#define MB_IGNORE_SIGNALS #ifdef MB_DEBUG #define MBDBG(fmt, arg...) printk(KERN_INFO fmt , ## arg) @@ -622,11 +622,6 @@ static int media_bay_task(void *x) { int i; - strcpy(current->comm, "media-bay"); -#ifdef MB_IGNORE_SIGNALS - sigfillset(¤t->blocked); -#endif - for (;;) { for (i = 0; i < media_bay_count; ++i) { down(&media_bays[i].lock); @@ -636,8 +631,6 @@ static int media_bay_task(void *x) } msleep_interruptible(MB_POLL_DELAY); - if (signal_pending(current)) - return 0; } } @@ -699,7 +692,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; -- 1.5.0.g53756