aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio.c
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 /drivers/input/serio/serio.c
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>
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r--drivers/input/serio/serio.c8
1 files changed, 2 insertions, 6 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 }