* [KJ] [PATCH] media/saa7110: remove sleep_on*() usage
@ 2005-01-26 19:45 Nishanth Aravamudan
2005-01-27 0:20 ` Nishanth Aravamudan
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-01-26 19:45 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]
Hi,
Please consider applying.
Description: Directly use wait-queues instead of the deprecated
sleep_on_timeout(). Since the sleep in this function is unconditional,
wait_event_timeout() does not appear to be appropriate. Patch is
compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-rc2-kj-v/drivers/media/video/saa7110.c 2005-01-24 09:34:08.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/media/video/saa7110.c 2005-01-26 10:42:51.000000000 -0800
@@ -30,6 +30,7 @@
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/wait.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -205,13 +206,16 @@ static const unsigned char initseq[] = {
static int
determine_norm (struct i2c_client *client)
{
+ DEFINE_WAIT(wait);
struct saa7110 *decoder = i2c_get_clientdata(client);
int status;
/* mode changed, start automatic detection */
saa7110_write_block(client, initseq, sizeof(initseq));
saa7110_selmux(client, decoder->input);
- sleep_on_timeout(&decoder->wq, HZ / 4);
+ prepare_to_wait(&decoder->wq, &wait, TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/4);
+ finish_wait(&decoder->wq, &wait);
status = saa7110_read(client);
if (status & 0x40) {
dprintk(1, KERN_INFO "%s: status=0x%02x (no signal)\n",
@@ -250,7 +254,9 @@ determine_norm (struct i2c_client *clien
saa7110_write(client, 0x11, 0x59);
//saa7110_write(client,0x2E,0x9A);
- sleep_on_timeout(&decoder->wq, HZ / 4);
+ prepare_to_wait(&decoder->wq, &wait, TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/4);
+ finish_wait(&decoder->wq, &wait);
status = saa7110_read(client);
if ((status & 0x03) == 0x01) {
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [KJ] [PATCH] media/saa7110: remove sleep_on*() usage
2005-01-26 19:45 [KJ] [PATCH] media/saa7110: remove sleep_on*() usage Nishanth Aravamudan
@ 2005-01-27 0:20 ` Nishanth Aravamudan
0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-01-27 0:20 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
Hi,
The author of the driver requested I send the patch on the mjpeg maintainer &
list. Please consider applying.
Description: Directly use wait-queues instead of the deprecated
sleep_on_timeout(). Since the sleep in this function is unconditional,
wait_event_timeout() does not appear to be appropriate. Patch is
compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-rc2-kj-v/drivers/media/video/saa7110.c 2005-01-24 09:34:08.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/media/video/saa7110.c 2005-01-26 10:42:51.000000000 -0800
@@ -30,6 +30,7 @@
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/wait.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -205,13 +206,16 @@ static const unsigned char initseq[] = {
static int
determine_norm (struct i2c_client *client)
{
+ DEFINE_WAIT(wait);
struct saa7110 *decoder = i2c_get_clientdata(client);
int status;
/* mode changed, start automatic detection */
saa7110_write_block(client, initseq, sizeof(initseq));
saa7110_selmux(client, decoder->input);
- sleep_on_timeout(&decoder->wq, HZ / 4);
+ prepare_to_wait(&decoder->wq, &wait, TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/4);
+ finish_wait(&decoder->wq, &wait);
status = saa7110_read(client);
if (status & 0x40) {
dprintk(1, KERN_INFO "%s: status=0x%02x (no signal)\n",
@@ -250,7 +254,9 @@ determine_norm (struct i2c_client *clien
saa7110_write(client, 0x11, 0x59);
//saa7110_write(client,0x2E,0x9A);
- sleep_on_timeout(&decoder->wq, HZ / 4);
+ prepare_to_wait(&decoder->wq, &wait, TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/4);
+ finish_wait(&decoder->wq, &wait);
status = saa7110_read(client);
if ((status & 0x03) == 0x01) {
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-27 0:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-26 19:45 [KJ] [PATCH] media/saa7110: remove sleep_on*() usage Nishanth Aravamudan
2005-01-27 0:20 ` Nishanth Aravamudan
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.