diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-02 23:27:30 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-02 23:27:30 -0500 |
commit | b187dd7b5231bb359f587bf4d276ffd467ebc884 (patch) | |
tree | b296afbaa817b0a5a6c594aa6353e2db57fd3ca0 | |
parent | 1ea2a69d54f40ecebf594ce5abfa02d53682df8a (diff) |
Input: gameport - rearrange gameport_bus initialization
Initialize gameport_bus structure at compile time instead of at runtime
in gameport_init().
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/gameport/gameport.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index a0af97efe6ac..bba5894fcecd 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
@@ -730,12 +730,6 @@ static int gameport_driver_remove(struct device *dev) | |||
730 | return 0; | 730 | return 0; |
731 | } | 731 | } |
732 | 732 | ||
733 | static struct bus_type gameport_bus = { | ||
734 | .name = "gameport", | ||
735 | .probe = gameport_driver_probe, | ||
736 | .remove = gameport_driver_remove, | ||
737 | }; | ||
738 | |||
739 | static void gameport_add_driver(struct gameport_driver *drv) | 733 | static void gameport_add_driver(struct gameport_driver *drv) |
740 | { | 734 | { |
741 | int error; | 735 | int error; |
@@ -781,6 +775,15 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv) | |||
781 | return !gameport_drv->ignore; | 775 | return !gameport_drv->ignore; |
782 | } | 776 | } |
783 | 777 | ||
778 | static struct bus_type gameport_bus = { | ||
779 | .name = "gameport", | ||
780 | .dev_attrs = gameport_device_attrs, | ||
781 | .drv_attrs = gameport_driver_attrs, | ||
782 | .match = gameport_bus_match, | ||
783 | .probe = gameport_driver_probe, | ||
784 | .remove = gameport_driver_remove, | ||
785 | }; | ||
786 | |||
784 | static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *drv) | 787 | static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *drv) |
785 | { | 788 | { |
786 | mutex_lock(&gameport->drv_mutex); | 789 | mutex_lock(&gameport->drv_mutex); |
@@ -790,7 +793,6 @@ static void gameport_set_drv(struct gameport *gameport, struct gameport_driver * | |||
790 | 793 | ||
791 | int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode) | 794 | int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode) |
792 | { | 795 | { |
793 | |||
794 | if (gameport->open) { | 796 | if (gameport->open) { |
795 | if (gameport->open(gameport, mode)) { | 797 | if (gameport->open(gameport, mode)) { |
796 | return -1; | 798 | return -1; |
@@ -818,9 +820,6 @@ static int __init gameport_init(void) | |||
818 | { | 820 | { |
819 | int error; | 821 | int error; |
820 | 822 | ||
821 | gameport_bus.dev_attrs = gameport_device_attrs; | ||
822 | gameport_bus.drv_attrs = gameport_driver_attrs; | ||
823 | gameport_bus.match = gameport_bus_match; | ||
824 | error = bus_register(&gameport_bus); | 823 | error = bus_register(&gameport_bus); |
825 | if (error) { | 824 | if (error) { |
826 | printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error); | 825 | printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error); |