diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-05 20:34:45 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-08 15:36:22 -0500 |
commit | 91efa462054d44ae52b0c6c8325ed5e899f2cd17 (patch) | |
tree | 5d4bd50ab5dffc16b2dafdfb037c7390f7d549a0 | |
parent | a5782010b4e75cba571357efaa27df22a89427c2 (diff) |
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>
-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 = { | |||
258 | struct device nodemgr_dev_template_host = { | 258 | struct device nodemgr_dev_template_host = { |
259 | .bus = &ieee1394_bus_type, | 259 | .bus = &ieee1394_bus_type, |
260 | .release = nodemgr_release_host, | 260 | .release = nodemgr_release_host, |
261 | .driver = &nodemgr_mid_layer_driver, | ||
262 | }; | 261 | }; |
263 | 262 | ||
264 | 263 | ||
@@ -1850,22 +1849,31 @@ int init_ieee1394_nodemgr(void) | |||
1850 | 1849 | ||
1851 | error = class_register(&nodemgr_ne_class); | 1850 | error = class_register(&nodemgr_ne_class); |
1852 | if (error) | 1851 | if (error) |
1853 | return error; | 1852 | goto fail_ne; |
1854 | |||
1855 | error = class_register(&nodemgr_ud_class); | 1853 | error = class_register(&nodemgr_ud_class); |
1856 | if (error) { | 1854 | if (error) |
1857 | class_unregister(&nodemgr_ne_class); | 1855 | goto fail_ud; |
1858 | return error; | ||
1859 | } | ||
1860 | error = driver_register(&nodemgr_mid_layer_driver); | 1856 | error = driver_register(&nodemgr_mid_layer_driver); |
1857 | if (error) | ||
1858 | goto fail_ml; | ||
1859 | /* This driver is not used if nodemgr is off (disable_nodemgr=1). */ | ||
1860 | nodemgr_dev_template_host.driver = &nodemgr_mid_layer_driver; | ||
1861 | |||
1861 | hpsb_register_highlevel(&nodemgr_highlevel); | 1862 | hpsb_register_highlevel(&nodemgr_highlevel); |
1862 | return 0; | 1863 | return 0; |
1864 | |||
1865 | fail_ml: | ||
1866 | class_unregister(&nodemgr_ud_class); | ||
1867 | fail_ud: | ||
1868 | class_unregister(&nodemgr_ne_class); | ||
1869 | fail_ne: | ||
1870 | return error; | ||
1863 | } | 1871 | } |
1864 | 1872 | ||
1865 | void cleanup_ieee1394_nodemgr(void) | 1873 | void cleanup_ieee1394_nodemgr(void) |
1866 | { | 1874 | { |
1867 | hpsb_unregister_highlevel(&nodemgr_highlevel); | 1875 | hpsb_unregister_highlevel(&nodemgr_highlevel); |
1868 | 1876 | driver_unregister(&nodemgr_mid_layer_driver); | |
1869 | class_unregister(&nodemgr_ud_class); | 1877 | class_unregister(&nodemgr_ud_class); |
1870 | class_unregister(&nodemgr_ne_class); | 1878 | class_unregister(&nodemgr_ne_class); |
1871 | } | 1879 | } |