aboutsummaryrefslogtreecommitdiffstats
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 16:03:09 -0500
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)
761 if (retval < 0) 761 if (retval < 0)
762 return retval; 762 return retval;
763 763
764 fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops);
765 if (fw_cdev_major < 0) {
766 bus_unregister(&fw_bus_type);
767 return fw_cdev_major;
768 }
769
764 /* Add the vendor textual descriptor. */ 770 /* Add the vendor textual descriptor. */
765 retval = fw_core_add_descriptor(&vendor_id_descriptor); 771 retval = fw_core_add_descriptor(&vendor_id_descriptor);
766 BUG_ON(retval < 0); 772 BUG_ON(retval < 0);
@@ -772,6 +778,7 @@ static int __init fw_core_init(void)
772 778
773static void __exit fw_core_cleanup(void) 779static void __exit fw_core_cleanup(void)
774{ 780{
781 unregister_chrdev(fw_cdev_major, "firewire");
775 bus_unregister(&fw_bus_type); 782 bus_unregister(&fw_bus_type);
776} 783}
777 784