diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-06 02:34:45 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-08 21:36:22 +0100 |
commit | 91efa462054d44ae52b0c6c8325ed5e899f2cd17 (patch) | |
tree | 5d4bd50ab5dffc16b2dafdfb037c7390f7d549a0 /drivers/ieee1394 | |
parent | a5782010b4e75cba571357efaa27df22a89427c2 (diff) | |
download | linux-rpi3-91efa462054d44ae52b0c6c8325ed5e899f2cd17.tar.gz linux-rpi3-91efa462054d44ae52b0c6c8325ed5e899f2cd17.tar.bz2 linux-rpi3-91efa462054d44ae52b0c6c8325ed5e899f2cd17.zip |
ieee1394: fix host device registering when nodemgr disabled
Since my commit 8252bbb1363b7fe963a3eb6f8a36da619a6f5a65 in 2.6.20-rc1,
host devices have a dummy driver attached. Alas the driver was not
registered before use if ieee1394 was loaded with disable_nodemgr=1.
This resulted in non-functional FireWire drivers or kernel lockup.
http://bugzilla.kernel.org/show_bug.cgi?id=7942
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 6558c91674fe..ba9faeff4793 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -258,7 +258,6 @@ static struct device_driver nodemgr_mid_layer_driver = { struct device nodemgr_dev_template_host = { .bus = &ieee1394_bus_type, .release = nodemgr_release_host, - .driver = &nodemgr_mid_layer_driver, }; @@ -1850,22 +1849,31 @@ int init_ieee1394_nodemgr(void) error = class_register(&nodemgr_ne_class); if (error) - return error; - + goto fail_ne; error = class_register(&nodemgr_ud_class); - if (error) { - class_unregister(&nodemgr_ne_class); - return error; - } + if (error) + goto fail_ud; error = driver_register(&nodemgr_mid_layer_driver); + if (error) + goto fail_ml; + /* This driver is not used if nodemgr is off (disable_nodemgr=1). */ + nodemgr_dev_template_host.driver = &nodemgr_mid_layer_driver; + hpsb_register_highlevel(&nodemgr_highlevel); return 0; + +fail_ml: + class_unregister(&nodemgr_ud_class); +fail_ud: + class_unregister(&nodemgr_ne_class); +fail_ne: + return error; } void cleanup_ieee1394_nodemgr(void) { hpsb_unregister_highlevel(&nodemgr_highlevel); - + driver_unregister(&nodemgr_mid_layer_driver); class_unregister(&nodemgr_ud_class); class_unregister(&nodemgr_ne_class); } |