domain.c (b2911a593a705e54adde6d06d4657c1ff2f16583) domain.c (54e418106c765c5f3c378c770b0f8518632830da)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt bus support
4 *
5 * Copyright (C) 2017, Intel Corporation
6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
7 */
8

--- 786 unchanged lines hidden (view full) ---

795
796 return bus_for_each_dev(&tb_bus_type, NULL, tb, disconnect_xdomain);
797}
798
799int tb_domain_init(void)
800{
801 int ret;
802
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Thunderbolt bus support
4 *
5 * Copyright (C) 2017, Intel Corporation
6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
7 */
8

--- 786 unchanged lines hidden (view full) ---

795
796 return bus_for_each_dev(&tb_bus_type, NULL, tb, disconnect_xdomain);
797}
798
799int tb_domain_init(void)
800{
801 int ret;
802
803 tb_debugfs_init();
803 ret = tb_xdomain_init();
804 if (ret)
804 ret = tb_xdomain_init();
805 if (ret)
805 return ret;
806 goto err_debugfs;
806 ret = bus_register(&tb_bus_type);
807 if (ret)
807 ret = bus_register(&tb_bus_type);
808 if (ret)
808 tb_xdomain_exit();
809 goto err_xdomain;
809
810
811 return 0;
812
813err_xdomain:
814 tb_xdomain_exit();
815err_debugfs:
816 tb_debugfs_exit();
817
810 return ret;
811}
812
813void tb_domain_exit(void)
814{
815 bus_unregister(&tb_bus_type);
816 ida_destroy(&tb_domain_ida);
817 tb_nvm_exit();
818 tb_xdomain_exit();
818 return ret;
819}
820
821void tb_domain_exit(void)
822{
823 bus_unregister(&tb_bus_type);
824 ida_destroy(&tb_domain_ida);
825 tb_nvm_exit();
826 tb_xdomain_exit();
827 tb_debugfs_exit();
819}
828}