aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-01-05 20:56:03 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-01-06 03:23:51 -0500
commit361b7b5b032338361ea88412f1fc45479fdd5859 (patch)
treeaed4cc96a50f563a3adc1521d109269809a5b60f
parentcac9169bf75ea8cbaab75be9dbe5eb79a2bad6f5 (diff)
Input: gameport - 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/gameport/gameport.c6
-rw-r--r--include/linux/gameport.h1
2 files changed, 1 insertions, 6 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index ac11be08585e..f9e5f8e1690b 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -561,8 +561,6 @@ static void gameport_add_port(struct gameport *gameport)
561 printk(KERN_ERR 561 printk(KERN_ERR
562 "gameport: device_add() failed for %s (%s), error: %d\n", 562 "gameport: device_add() failed for %s (%s), error: %d\n",
563 gameport->phys, gameport->name, error); 563 gameport->phys, gameport->name, error);
564 else
565 gameport->registered = 1;
566} 564}
567 565
568/* 566/*
@@ -584,10 +582,8 @@ static void gameport_destroy_port(struct gameport *gameport)
584 gameport->parent = NULL; 582 gameport->parent = NULL;
585 } 583 }
586 584
587 if (gameport->registered) { 585 if (device_is_registered(&gameport->dev))
588 device_del(&gameport->dev); 586 device_del(&gameport->dev);
589 gameport->registered = 0;
590 }
591 587
592 list_del_init(&gameport->node); 588 list_del_init(&gameport->node);
593 589
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 1bc08541c2b9..48e68da097f6 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -46,7 +46,6 @@ struct gameport {
46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
47 47
48 struct device dev; 48 struct device dev;
49 unsigned int registered; /* port has been fully registered with driver core */
50 49
51 struct list_head node; 50 struct list_head node;
52}; 51};