diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-03 09:08:57 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-03 09:08:57 -0400 |
commit | 76467874b83835129dc454e3a7a8e5d1186101b0 (patch) | |
tree | 162129f0c36c35be4aa323cf00626db0e804c3fc /drivers/input/misc | |
parent | 8628de0583504138551a05ad44ca388467f0f552 (diff) | |
parent | 6246b6128bbe34d0752f119cf7c5111c85fe481d (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/pcspkr.c | 27 | ||||
-rw-r--r-- | drivers/input/misc/uinput.c | 14 |
2 files changed, 8 insertions, 33 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>"); | |||
24 | MODULE_DESCRIPTION("PC Speaker beeper driver"); | 24 | MODULE_DESCRIPTION("PC Speaker beeper driver"); |
25 | MODULE_LICENSE("GPL"); | 25 | MODULE_LICENSE("GPL"); |
26 | 26 | ||
27 | static struct platform_device *pcspkr_platform_device; | ||
28 | static DEFINE_SPINLOCK(i8253_beep_lock); | 27 | static DEFINE_SPINLOCK(i8253_beep_lock); |
29 | 28 | ||
30 | static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 29 | static 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 | ||
136 | static int __init pcspkr_init(void) | 135 | static 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 | ||
164 | static void __exit pcspkr_exit(void) | 140 | static 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 | ||
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 546ed9b4901d..d723e9ad7c41 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
@@ -194,7 +194,7 @@ static int uinput_open(struct inode *inode, struct file *file) | |||
194 | if (!newdev) | 194 | if (!newdev) |
195 | return -ENOMEM; | 195 | return -ENOMEM; |
196 | 196 | ||
197 | init_MUTEX(&newdev->sem); | 197 | mutex_init(&newdev->mutex); |
198 | spin_lock_init(&newdev->requests_lock); | 198 | spin_lock_init(&newdev->requests_lock); |
199 | init_waitqueue_head(&newdev->requests_waitq); | 199 | init_waitqueue_head(&newdev->requests_waitq); |
200 | init_waitqueue_head(&newdev->waitq); | 200 | init_waitqueue_head(&newdev->waitq); |
@@ -340,7 +340,7 @@ static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t | |||
340 | struct uinput_device *udev = file->private_data; | 340 | struct uinput_device *udev = file->private_data; |
341 | int retval; | 341 | int retval; |
342 | 342 | ||
343 | retval = down_interruptible(&udev->sem); | 343 | retval = mutex_lock_interruptible(&udev->mutex); |
344 | if (retval) | 344 | if (retval) |
345 | return retval; | 345 | return retval; |
346 | 346 | ||
@@ -348,7 +348,7 @@ static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t | |||
348 | uinput_inject_event(udev, buffer, count) : | 348 | uinput_inject_event(udev, buffer, count) : |
349 | uinput_setup_device(udev, buffer, count); | 349 | uinput_setup_device(udev, buffer, count); |
350 | 350 | ||
351 | up(&udev->sem); | 351 | mutex_unlock(&udev->mutex); |
352 | 352 | ||
353 | return retval; | 353 | return retval; |
354 | } | 354 | } |
@@ -369,7 +369,7 @@ static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, | |||
369 | if (retval) | 369 | if (retval) |
370 | return retval; | 370 | return retval; |
371 | 371 | ||
372 | retval = down_interruptible(&udev->sem); | 372 | retval = mutex_lock_interruptible(&udev->mutex); |
373 | if (retval) | 373 | if (retval) |
374 | return retval; | 374 | return retval; |
375 | 375 | ||
@@ -388,7 +388,7 @@ static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, | |||
388 | } | 388 | } |
389 | 389 | ||
390 | out: | 390 | out: |
391 | up(&udev->sem); | 391 | mutex_unlock(&udev->mutex); |
392 | 392 | ||
393 | return retval; | 393 | return retval; |
394 | } | 394 | } |
@@ -439,7 +439,7 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
439 | 439 | ||
440 | udev = file->private_data; | 440 | udev = file->private_data; |
441 | 441 | ||
442 | retval = down_interruptible(&udev->sem); | 442 | retval = mutex_lock_interruptible(&udev->mutex); |
443 | if (retval) | 443 | if (retval) |
444 | return retval; | 444 | return retval; |
445 | 445 | ||
@@ -589,7 +589,7 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
589 | } | 589 | } |
590 | 590 | ||
591 | out: | 591 | out: |
592 | up(&udev->sem); | 592 | mutex_unlock(&udev->mutex); |
593 | return retval; | 593 | return retval; |
594 | } | 594 | } |
595 | 595 | ||