lkml.org 
[lkml]   [2004]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/16] Add serio start and stop methods
Date

===================================================================


ChangeSet@1.1957.1.29, 2004-11-12 01:25:01-05:00, dtor_core@ameritech.net
Input: add serio->start() and serio->stop() callback methods that
are called whenever serio port is finishes being registered
or unregistered. The callbacks are useful for drivers that
share interrupt between several ports and there is a danger
that interrupt handler will reference port that was just
unregistered.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


drivers/input/serio/serio.c | 8 +++++++-
include/linux/serio.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)


===================================================================



diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c 2004-12-29 01:46:30 -05:00
+++ b/drivers/input/serio/serio.c 2004-12-29 01:46:30 -05:00
@@ -328,7 +328,10 @@
serio->dev.release = serio_release_port;
if (serio->parent)
serio->dev.parent = &serio->parent->dev;
- device_register(&serio->dev);
+ device_initialize(&serio->dev);
+ if (serio->start)
+ serio->start(serio);
+ device_add(&serio->dev);
}

/*
@@ -350,6 +353,9 @@
up_write(&serio_bus.subsys.rwsem);
put_driver(&drv->driver);
}
+
+ if (serio->stop)
+ serio->stop(serio);

if (serio->parent) {
spin_lock_irqsave(&serio->parent->lock, flags);
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
--- a/include/linux/serio.h 2004-12-29 01:46:30 -05:00
+++ b/include/linux/serio.h 2004-12-29 01:46:30 -05:00
@@ -42,6 +42,8 @@
int (*write)(struct serio *, unsigned char);
int (*open)(struct serio *);
void (*close)(struct serio *);
+ int (*start)(struct serio *);
+ void (*stop)(struct serio *);

struct serio *parent, *child;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.095 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site