aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/pcspkr.c
diff options
context:
space:
mode:
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