summaryrefslogtreecommitdiff
path: root/drivers/firewire/fw-transaction.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-03-07 12:12:44 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 22:03:09 +0100
commita3aca3dabbcf00f2088d472f27755c29acaa992e (patch)
treec6b23c1d51a7eab5bee4137d344264974ddfc432 /drivers/firewire/fw-transaction.c
parent344bbc4de14e70d03f09bff04bb7d161b8a0d28c (diff)
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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index 8e2b94557390..3052698c13a6 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);
}