diff --git a/repos/os/include/spec/arm/platform_session/device.h b/repos/os/include/spec/arm/platform_session/device.h index d70eacd997..61b8f86322 100644 --- a/repos/os/include/spec/arm/platform_session/device.h +++ b/repos/os/include/spec/arm/platform_session/device.h @@ -70,6 +70,11 @@ class Platform::Device : Interface, Noncopyable _platform(platform), _cap(platform.device_by_type(type.name.string())) { } + Device(Connection &platform, Name name) + : + _platform(platform), _cap(platform.acquire_device(name)) + { } + ~Device() { _platform.release_device(_cap); } }; diff --git a/repos/os/src/drivers/nic/virtio/mmio_device.cc b/repos/os/src/drivers/nic/virtio/mmio_device.cc index b9a522c6ef..9168412df1 100644 --- a/repos/os/src/drivers/nic/virtio/mmio_device.cc +++ b/repos/os/src/drivers/nic/virtio/mmio_device.cc @@ -35,7 +35,8 @@ struct Virtio_mmio_nic::Main Env & env; Heap heap { env.ram(), env.rm() }; Platform::Connection platform { env }; - Platform::Device platform_device { platform, { "nic" } }; + Platform::Device platform_device { platform, + Platform::Device::Type { "nic" } }; Virtio::Device device { platform_device }; Attached_rom_dataspace config_rom { env, "config" }; Constructible root { };