From 7d241968ff4feb83bc23636df3a7ddb80f4bb4a9 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 24 Jul 2026 00:55:57 +0200 Subject: kapi/device: remove init() --- kernel/kapi/devices/bus.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'kernel/kapi/devices/bus.cpp') 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 #include -#include #include #include -#include #include #include @@ -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 child) -> void { child->set_parent(kstd::static_pointer_cast(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 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 -- cgit v1.2.3