All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] 7/34: block/ps2esdi: replace sleep_on() with
Date: Tue, 25 Jan 2005 22:30:58 +0000	[thread overview]
Message-ID: <20050125223058.GH2689@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

Hi,

Please consider applying.

Description: Use wait_event() instead of the deprecated sleep_on(). The latter
two replacements treat the current if-conditional as a while-conditional. I am
not sure if this will result in the desired behavior. The first change required
using wait-queue code directly with a local wait-queue, as the sleep is not
conditional currently.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.11-rc2-kj-v/drivers/block/ps2esdi.c	2005-01-24 09:34:04.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/block/ps2esdi.c	2005-01-25 13:39:48.000000000 -0800
@@ -43,6 +43,7 @@
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -292,6 +293,7 @@ static int __init ps2esdi_geninit(void)
 	   we will set the INIT_FLAG to a non-zero value.
 	 */
 
+	DEFINE_WAIT(wait);
 	int slot = 0, i, reset_start, reset_end;
 	u_char status;
 	unsigned short adapterID;
@@ -373,11 +375,13 @@ static int __init ps2esdi_geninit(void)
 	reset_status = 0;
 	reset_start = jiffies;
 	while (!reset_status) {
+		prepare_to_wait(&ps2esdi_int, &wait, TASK_UNINTERRUPTIBLE);
 		init_timer(&esdi_timer);
 		esdi_timer.expires = jiffies + HZ;
 		esdi_timer.data = 0;
 		add_timer(&esdi_timer);
-		sleep_on(&ps2esdi_int);
+		schedule();
+		finish_wait(&ps2esdi_int, &wait);
 	}
 	reset_end = jiffies;
 	LITE_OFF;
@@ -461,8 +465,7 @@ static void __init ps2esdi_get_device_cf
 	cmd_blk[1] = 0;
 	no_int_yet = TRUE;
 	ps2esdi_out_cmd_blk(cmd_blk);
-	if (no_int_yet)
-		sleep_on(&ps2esdi_int);
+	wait_event(ps2esdi_int, !no_int_yet);
 
 	if (ps2esdi_drives > 1) {
 		printk("%s: Drive 1\n", DEVICE_NAME);	/*BA */
@@ -470,8 +473,7 @@ static void __init ps2esdi_get_device_cf
 		cmd_blk[1] = 0;
 		no_int_yet = TRUE;
 		ps2esdi_out_cmd_blk(cmd_blk);
-		if (no_int_yet)
-			sleep_on(&ps2esdi_int);
+		wait_event(ps2esdi_int, !no_int_yet);
 	}			/* if second physical drive is present */
 	return;
 }

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

                 reply	other threads:[~2005-01-25 22:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050125223058.GH2689@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.