aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:49:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:49:58 -0400
commite80ab411e589e00550e2e6e5a6a02d59cc730357 (patch)
tree870225ff7b5b8d03e82a996963213a4bb9cce248 /drivers/char
parent529a41e36673b518c9e091f3a8d932b6b9e3c461 (diff)
parentee959b00c335d7780136c5abda37809191fe52c3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits) SCSI: convert struct class_device to struct device DRM: remove unused dev_class IB: rename "dev" to "srp_dev" in srp_host structure IB: convert struct class_device to struct device memstick: convert struct class_device to struct device driver core: replace remaining __FUNCTION__ occurrences sysfs: refill attribute buffer when reading from offset 0 PM: Remove destroy_suspended_device() Firmware: add iSCSI iBFT Support PM: Remove legacy PM (fix) Kobject: Replace list_for_each() with list_for_each_entry(). SYSFS: Explicitly include required header file slab.h. Driver core: make device_is_registered() work for class devices PM: Convert wakeup flag accessors to inline functions PM: Make wakeup flags available whenever CONFIG_PM is set PM: Fix misuse of wakeup flag accessors in serial core Driver core: Call device_pm_add() after bus_add_device() in device_add() PM: Handle device registrations during suspend/resume block: send disk "change" event for rescan_partitions() sysdev: detect multiple driver registrations ... Fixed trivial conflict in include/linux/memory.h due to semaphore header file change (made irrelevant by the change to mutex).
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/drm/drmP.h1
-rw-r--r--drivers/char/hw_random/core.c10
-rw-r--r--drivers/char/misc.c13
3 files changed, 9 insertions, 15 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 8ea9dd1717a9..6540948d5176 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -640,7 +640,6 @@ struct drm_head {
640 struct drm_device *dev; 640 struct drm_device *dev;
641 struct proc_dir_entry *dev_root; /**< proc directory entry */ 641 struct proc_dir_entry *dev_root; /**< proc directory entry */
642 dev_t device; /**< Device number for mknod */ 642 dev_t device; /**< Device number for mknod */
643 struct class_device *dev_class;
644}; 643};
645 644
646/** 645/**
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 349b6edc5794..662d60e44e9a 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -238,11 +238,11 @@ static DEVICE_ATTR(rng_available, S_IRUGO,
238 NULL); 238 NULL);
239 239
240 240
241static void unregister_miscdev(bool suspended) 241static void unregister_miscdev(void)
242{ 242{
243 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available); 243 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available);
244 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current); 244 device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current);
245 __misc_deregister(&rng_miscdev, suspended); 245 misc_deregister(&rng_miscdev);
246} 246}
247 247
248static int register_miscdev(void) 248static int register_miscdev(void)
@@ -317,7 +317,7 @@ out:
317} 317}
318EXPORT_SYMBOL_GPL(hwrng_register); 318EXPORT_SYMBOL_GPL(hwrng_register);
319 319
320void __hwrng_unregister(struct hwrng *rng, bool suspended) 320void hwrng_unregister(struct hwrng *rng)
321{ 321{
322 int err; 322 int err;
323 323
@@ -336,11 +336,11 @@ void __hwrng_unregister(struct hwrng *rng, bool suspended)
336 } 336 }
337 } 337 }
338 if (list_empty(&rng_list)) 338 if (list_empty(&rng_list))
339 unregister_miscdev(suspended); 339 unregister_miscdev();
340 340
341 mutex_unlock(&rng_mutex); 341 mutex_unlock(&rng_mutex);
342} 342}
343EXPORT_SYMBOL_GPL(__hwrng_unregister); 343EXPORT_SYMBOL_GPL(hwrng_unregister);
344 344
345 345
346MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver"); 346MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index a39101feb2ed..4d058dadbfcc 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -232,9 +232,8 @@ int misc_register(struct miscdevice * misc)
232} 232}
233 233
234/** 234/**
235 * __misc_deregister - unregister a miscellaneous device 235 * misc_deregister - unregister a miscellaneous device
236 * @misc: device to unregister 236 * @misc: device to unregister
237 * @suspended: to be set if the function is used during suspend/resume
238 * 237 *
239 * Unregister a miscellaneous device that was previously 238 * Unregister a miscellaneous device that was previously
240 * successfully registered with misc_register(). Success 239 * successfully registered with misc_register(). Success
@@ -242,7 +241,7 @@ int misc_register(struct miscdevice * misc)
242 * indicates an error. 241 * indicates an error.
243 */ 242 */
244 243
245int __misc_deregister(struct miscdevice *misc, bool suspended) 244int misc_deregister(struct miscdevice *misc)
246{ 245{
247 int i = misc->minor; 246 int i = misc->minor;
248 247
@@ -251,11 +250,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
251 250
252 mutex_lock(&misc_mtx); 251 mutex_lock(&misc_mtx);
253 list_del(&misc->list); 252 list_del(&misc->list);
254 if (suspended) 253 device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
255 destroy_suspended_device(misc_class,
256 MKDEV(MISC_MAJOR, misc->minor));
257 else
258 device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
259 if (i < DYNAMIC_MINORS && i>0) { 254 if (i < DYNAMIC_MINORS && i>0) {
260 misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); 255 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
261 } 256 }
@@ -264,7 +259,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
264} 259}
265 260
266EXPORT_SYMBOL(misc_register); 261EXPORT_SYMBOL(misc_register);
267EXPORT_SYMBOL(__misc_deregister); 262EXPORT_SYMBOL(misc_deregister);
268 263
269static int __init misc_init(void) 264static int __init misc_init(void)
270{ 265{