From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: [PATCH 17/15] New set of input patches: serio open/close optional
Date: Thu, 22 Apr 2004 02:29:38 -0500 [thread overview]
Message-ID: <200404220229.41680.dtor_core@ameritech.net> (raw)
In-Reply-To: <200404220156.42083.dtor_core@ameritech.net>
Extra stuff slipped into the previous patch, this one better...
===================================================================
ChangeSet@1.1928, 2004-04-22 02:26:37-05:00, dtor_core@ameritech.net
Input: make serio open and close methods optional
mouse/synaptics.c | 11 -----------
serio/parkbd.c | 11 -----------
serio/q40kbd.c | 11 -----------
serio/serio.c | 5 +++--
serio/serport.c | 10 ++--------
5 files changed, 5 insertions(+), 43 deletions(-)
===================================================================
diff -Nru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- a/drivers/input/mouse/synaptics.c Thu Apr 22 02:27:22 2004
+++ b/drivers/input/mouse/synaptics.c Thu Apr 22 02:27:22 2004
@@ -212,15 +212,6 @@
/*****************************************************************************
* Synaptics pass-through PS/2 port support
****************************************************************************/
-static int synaptics_pt_open(struct serio *port)
-{
- return 0;
-}
-
-static void synaptics_pt_close(struct serio *port)
-{
-}
-
static int synaptics_pt_write(struct serio *port, unsigned char c)
{
struct psmouse *parent = port->driver;
@@ -282,8 +273,6 @@
port->serio.name = "Synaptics pass-through";
port->serio.phys = "synaptics-pt/serio0";
port->serio.write = synaptics_pt_write;
- port->serio.open = synaptics_pt_open;
- port->serio.close = synaptics_pt_close;
port->serio.driver = psmouse;
port->activate = synaptics_pt_activate;
diff -Nru a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
--- a/drivers/input/serio/parkbd.c Thu Apr 22 02:27:22 2004
+++ b/drivers/input/serio/parkbd.c Thu Apr 22 02:27:22 2004
@@ -86,20 +86,9 @@
return 0;
}
-static int parkbd_open(struct serio *port)
-{
- return 0;
-}
-
-static void parkbd_close(struct serio *port)
-{
-}
-
static struct serio parkbd_port =
{
.write = parkbd_write,
- .open = parkbd_open,
- .close = parkbd_close,
.name = parkbd_name,
.phys = parkbd_phys,
};
diff -Nru a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
--- a/drivers/input/serio/q40kbd.c Thu Apr 22 02:27:22 2004
+++ b/drivers/input/serio/q40kbd.c Thu Apr 22 02:27:22 2004
@@ -47,23 +47,12 @@
MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver");
MODULE_LICENSE("GPL");
-
-static int q40kbd_open(struct serio *port)
-{
- return 0;
-}
-static void q40kbd_close(struct serio *port)
-{
-}
-
static struct serio q40kbd_port =
{
.type = SERIO_8042,
.name = "Q40 kbd port",
.phys = "Q40",
.write = NULL,
- .open = q40kbd_open,
- .close = q40kbd_close,
};
static irqreturn_t q40kbd_interrupt(int irq, void *dev_id,
diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c Thu Apr 22 02:27:22 2004
+++ b/drivers/input/serio/serio.c Thu Apr 22 02:27:22 2004
@@ -293,7 +293,7 @@
int serio_open(struct serio *serio, struct serio_dev *dev)
{
serio->dev = dev;
- if (serio->open(serio)) {
+ if (serio->open && serio->open(serio)) {
serio->dev = NULL;
return -1;
}
@@ -303,7 +303,8 @@
/* called from serio_dev->connect/disconnect methods under serio_sem */
void serio_close(struct serio *serio)
{
- serio->close(serio);
+ if (serio->close)
+ serio->close(serio);
serio->dev = NULL;
}
diff -Nru a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
--- a/drivers/input/serio/serport.c Thu Apr 22 02:27:22 2004
+++ b/drivers/input/serio/serport.c Thu Apr 22 02:27:22 2004
@@ -48,11 +48,6 @@
return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1);
}
-static int serport_serio_open(struct serio *serio)
-{
- return 0;
-}
-
static void serport_serio_close(struct serio *serio)
{
struct serport *serport = serio->driver;
@@ -87,7 +82,6 @@
serport->serio.type = SERIO_RS232;
serport->serio.write = serport_serio_write;
- serport->serio.open = serport_serio_open;
serport->serio.close = serport_serio_close;
serport->serio.driver = serport;
@@ -135,7 +129,7 @@
}
/*
- * serport_ldisc_read() just waits indefinitely if everything goes well.
+ * serport_ldisc_read() just waits indefinitely if everything goes well.
* However, when the serio driver closes the serio port, it finishes,
* returning 0 characters.
*/
@@ -165,7 +159,7 @@
static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg)
{
struct serport *serport = (struct serport*) tty->disc_data;
-
+
if (cmd == SPIOCSTYPE)
return get_user(serport->serio.type, (unsigned long *) arg);
prev parent reply other threads:[~2004-04-22 7:40 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-21 5:49 [PATCH 0/15] New set of input patches Dmitry Torokhov
2004-04-21 5:50 ` [PATCH 1/15] New set of input patches: synaptics cleanup Dmitry Torokhov
2004-04-21 5:51 ` [PATCH 2/15] New set of input patches: synaptics middle button support Dmitry Torokhov
2004-04-21 5:51 ` [PATCH 3/15] New set of input patches: dont change max proto Dmitry Torokhov
2004-04-21 5:52 ` [PATCH 4/15] New set of input patches: lkkbd whitespace Dmitry Torokhov
2004-04-21 11:39 ` Jan-Benedict Glaw
2004-04-21 12:40 ` [New-PATCH] lkkbd: Current version Jan-Benedict Glaw
2004-04-22 7:27 ` [PATCH 4/15] New set of input patches: lkkbd whitespace Vojtech Pavlik
2004-04-21 5:53 ` [PATCH 5/15] New set of input patches: lkkbd simplify checks Dmitry Torokhov
2004-04-21 11:34 ` Jan-Benedict Glaw
2004-04-21 5:54 ` [PATCH 6/15] New set of input patches: atkbd soften accusation Dmitry Torokhov
2004-04-21 14:13 ` Giuseppe Bilotta
2004-04-21 5:56 ` [PATCH 7/15] New set of input patches: atkbd trailing whitespace Dmitry Torokhov
2004-04-21 5:57 ` [PATCH 8/15] New set of input patches: atkbd - use bitfields Dmitry Torokhov
2004-04-22 7:31 ` Vojtech Pavlik
2004-04-22 7:41 ` Dmitry Torokhov
2004-04-22 7:58 ` Vojtech Pavlik
2004-04-25 6:25 ` Pavel Machek
2004-04-21 5:58 ` [PATCH 9/15] New set of input patches: atkbd timeout complaints Dmitry Torokhov
2004-04-22 7:32 ` Vojtech Pavlik
2004-04-22 7:43 ` Dmitry Torokhov
2004-04-21 6:00 ` [PATCH 10/15] New set of input patches: psmouse rescan on hotplug Dmitry Torokhov
2004-04-21 6:01 ` [PATCH 11/15] New set of input patches: psmouse reconnect after error Dmitry Torokhov
2004-04-21 6:01 ` [PATCH 12/15] New set of input patches: psmouse add protocol_handler Dmitry Torokhov
2004-04-21 6:02 ` [PATCH 13/15] New set of input patches: psmouse sliced commands Dmitry Torokhov
2004-04-21 6:04 ` [PATCH 14/15] New set of input patches: atkbd reconnect probe Dmitry Torokhov
2004-04-21 6:05 ` [PATCH 15/15] New set of input patches: allow disabling psaux Dmitry Torokhov
2004-04-21 12:43 ` [PATCH 0/15] New set of input patches Jan-Benedict Glaw
2004-04-22 6:43 ` [PATCH 16/15] New set of input patches: serio whitespace Dmitry Torokhov
2004-04-22 6:56 ` [PATCH 17/15] New set of input patches: serio open/close optional Dmitry Torokhov
2004-04-22 7:29 ` Dmitry Torokhov [this message]
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=200404220229.41680.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox