aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/pcspkr.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2006-03-14 00:11:50 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-03-14 00:11:50 -0500
commite5c6c8e457d16c7cbc12f849ad18d4d508950de2 (patch)
tree25a6342ef5fa5ae19f1fbaed8538290225dba38d /drivers/input/misc/pcspkr.c
parentaaef685d5726768d25cbdc672a59c284d820b82e (diff)
Input: pcspkr - separate device and driver registration
The current pcspkr code combines the device and driver registration. This patch splits these, putting the device registration in the arch specific code. PowerPC and MIPS only have the pcspkr present sometimes. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc/pcspkr.c')
-rw-r--r--drivers/input/misc/pcspkr.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 1ef477f4469c..afd322185bbf 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -24,7 +24,6 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
24MODULE_DESCRIPTION("PC Speaker beeper driver"); 24MODULE_DESCRIPTION("PC Speaker beeper driver");
25MODULE_LICENSE("GPL"); 25MODULE_LICENSE("GPL");
26 26
27static struct platform_device *pcspkr_platform_device;
28static DEFINE_SPINLOCK(i8253_beep_lock); 27static DEFINE_SPINLOCK(i8253_beep_lock);
29 28
30static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 29static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
@@ -135,35 +134,11 @@ static struct platform_driver pcspkr_platform_driver = {
135 134
136static int __init pcspkr_init(void) 135static int __init pcspkr_init(void)
137{ 136{
138 int err; 137 return platform_driver_register(&pcspkr_platform_driver);
139
140 err = platform_driver_register(&pcspkr_platform_driver);
141 if (err)
142 return err;
143
144 pcspkr_platform_device = platform_device_alloc("pcspkr", -1);
145 if (!pcspkr_platform_device) {
146 err = -ENOMEM;
147 goto err_unregister_driver;
148 }
149
150 err = platform_device_add(pcspkr_platform_device);
151 if (err)
152 goto err_free_device;
153
154 return 0;
155
156 err_free_device:
157 platform_device_put(pcspkr_platform_device);
158 err_unregister_driver:
159 platform_driver_unregister(&pcspkr_platform_driver);
160
161 return err;
162} 138}
163 139
164static void __exit pcspkr_exit(void) 140static void __exit pcspkr_exit(void)
165{ 141{
166 platform_device_unregister(pcspkr_platform_device);
167 platform_driver_unregister(&pcspkr_platform_driver); 142 platform_driver_unregister(&pcspkr_platform_driver);
168} 143}
169 144