aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ieee1394/nodemgr.c24
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 = {
258struct device nodemgr_dev_template_host = { 258struct 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
1865fail_ml:
1866 class_unregister(&nodemgr_ud_class);
1867fail_ud:
1868 class_unregister(&nodemgr_ne_class);
1869fail_ne:
1870 return error;
1863} 1871}
1864 1872
1865void cleanup_ieee1394_nodemgr(void) 1873void 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}