aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/devices/bus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kapi/devices/bus.cpp')
-rw-r--r--kernel/kapi/devices/bus.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/kernel/kapi/devices/bus.cpp b/kernel/kapi/devices/bus.cpp
index 25e35733..db693eac 100644
--- a/kernel/kapi/devices/bus.cpp
+++ b/kernel/kapi/devices/bus.cpp
@@ -5,11 +5,9 @@
#include <kapi/system.hpp>
#include <kstd/memory.hpp>
-#include <kstd/print.hpp>
#include <kstd/string.hpp>
#include <kstd/vector.hpp>
-#include <algorithm>
#include <span>
#include <utility>
@@ -19,30 +17,6 @@ namespace kapi::devices
: device{name}
{}
- auto bus::init() -> bool
- {
- if (m_init_was_called.test_and_set())
- {
- kstd::println(kstd::print_sink::stderr, "[OS:DEV] Bus {} already initialized", name());
- return true;
- }
-
- if (!enumerate_old())
- {
- kstd::println(kstd::print_sink::stderr, "[OS:DEV] Bus {} enumeration failed", name());
- return false;
- }
-
- auto child_status = std::ranges::fold_left(m_devices, true, [&](bool acc, auto & child) -> bool {
- kstd::println("[OS:DEV] Initializing child device {}@{}", child->name(), name());
- return child->init() && acc;
- });
-
- m_initialized.test_and_set();
-
- return child_status;
- }
-
auto bus::add_child(kstd::shared_ptr<device> child) -> void
{
child->set_parent(kstd::static_pointer_cast<bus>(shared_from_this()));
@@ -56,15 +30,6 @@ namespace kapi::devices
attached->set_state(state::present);
driver_registry::get().device_attached(attached);
-
- if (m_initialized.test())
- {
- kstd::println("[OS:DEV] Initializing child device {}@{}", attached->name(), name());
- if (!attached->init())
- {
- kapi::system::panic("[OS:DEV] Failed to initialize child device");
- }
- }
}
[[nodiscard]] auto bus::children() const -> std::span<kstd::shared_ptr<device> const>
@@ -77,9 +42,4 @@ namespace kapi::devices
return nullptr;
}
- auto bus::enumerate_old() -> bool
- {
- return true;
- }
-
} // namespace kapi::devices \ No newline at end of file