diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-03-07 12:12:44 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-09 22:03:09 +0100 |
commit | a3aca3dabbcf00f2088d472f27755c29acaa992e (patch) | |
tree | c6b23c1d51a7eab5bee4137d344264974ddfc432 /drivers/firewire/fw-transaction.c | |
parent | 344bbc4de14e70d03f09bff04bb7d161b8a0d28c (diff) | |
download | kernel_samsung_smdk4412-a3aca3dabbcf00f2088d472f27755c29acaa992e.zip kernel_samsung_smdk4412-a3aca3dabbcf00f2088d472f27755c29acaa992e.tar.gz kernel_samsung_smdk4412-a3aca3dabbcf00f2088d472f27755c29acaa992e.tar.bz2 |
firewire: Switch cdev code over to use register_chrdev and keep a list of devices.
The old mechanism kept a struct cdev for each fw device, but fops->release
would reference this struct after the device got freed in some cases.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-transaction.c')
-rw-r--r-- | drivers/firewire/fw-transaction.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c index 8e2b945..3052698 100644 --- a/drivers/firewire/fw-transaction.c +++ b/drivers/firewire/fw-transaction.c @@ -761,6 +761,12 @@ static int __init fw_core_init(void) if (retval < 0) return retval; + fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops); + if (fw_cdev_major < 0) { + bus_unregister(&fw_bus_type); + return fw_cdev_major; + } + /* Add the vendor textual descriptor. */ retval = fw_core_add_descriptor(&vendor_id_descriptor); BUG_ON(retval < 0); @@ -772,6 +778,7 @@ static int __init fw_core_init(void) static void __exit fw_core_cleanup(void) { + unregister_chrdev(fw_cdev_major, "firewire"); bus_unregister(&fw_bus_type); } |