aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-01-05 20:56:04 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-01-06 03:22:00 -0500
commitddf1ffbd40c92ff1e58c45fa96d309788f7beb60 (patch)
tree4386c23fb68c55a7574ede5264c58f5412364efc
parent386d8772980be01b94bd463ea1e745732d7eb502 (diff)
Input: serio - let device core tell us if device was registered
No need to keep track of it by ourselves. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/serio/serio.c8
-rw-r--r--include/linux/serio.h1
2 files changed, 2 insertions, 7 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 0a278f9f1d3a..d89880450f77 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -577,8 +577,6 @@ static void serio_add_port(struct serio *serio)
577 printk(KERN_ERR 577 printk(KERN_ERR
578 "serio: device_add() failed for %s (%s), error: %d\n", 578 "serio: device_add() failed for %s (%s), error: %d\n",
579 serio->phys, serio->name, error); 579 serio->phys, serio->name, error);
580 else
581 serio->registered = true;
582} 580}
583 581
584/* 582/*
@@ -605,10 +603,8 @@ static void serio_destroy_port(struct serio *serio)
605 serio->parent = NULL; 603 serio->parent = NULL;
606 } 604 }
607 605
608 if (serio->registered) { 606 if (device_is_registered(&serio->dev))
609 device_del(&serio->dev); 607 device_del(&serio->dev);
610 serio->registered = false;
611 }
612 608
613 list_del_init(&serio->node); 609 list_del_init(&serio->node);
614 serio_remove_pending_events(serio); 610 serio_remove_pending_events(serio);
@@ -995,7 +991,7 @@ irqreturn_t serio_interrupt(struct serio *serio,
995 991
996 if (likely(serio->drv)) { 992 if (likely(serio->drv)) {
997 ret = serio->drv->interrupt(serio, data, dfl); 993 ret = serio->drv->interrupt(serio, data, dfl);
998 } else if (!dfl && serio->registered) { 994 } else if (!dfl && device_is_registered(&serio->dev)) {
999 serio_rescan(serio); 995 serio_rescan(serio);
1000 ret = IRQ_HANDLED; 996 ret = IRQ_HANDLED;
1001 } 997 }
diff --git a/include/linux/serio.h b/include/linux/serio.h
index e2f3044d4a4a..d0fb702059cd 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -30,7 +30,6 @@ struct serio {
30 char phys[32]; 30 char phys[32];
31 31
32 bool manual_bind; 32 bool manual_bind;
33 bool registered; /* port has been fully registered with driver core */
34 33
35 struct serio_device_id id; 34 struct serio_device_id id;
36 35