1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Kernel/Devices: Remove required_mode and device_name methods

These methods are no longer needed because SystemServer is able to
populate the DevFS on its own.

Device absolute_path no longer assume a path to the /dev location,
because it really should not assume any path to a Device node.

Because StorageManagement still needs to know the storage name, we
declare a virtual method only for StorageDevices to override, but this
technique should really be removed later on.
This commit is contained in:
Liav A 2021-08-14 07:01:19 +03:00 committed by Andreas Kling
parent 4f04cb98c1
commit 21b6d84ff0
38 changed files with 18 additions and 141 deletions

View file

@ -84,11 +84,6 @@ void FramebufferDevice::activate_writes()
m_graphical_writes_enabled = true;
}
String FramebufferDevice::device_name() const
{
return String::formatted("fb{}", minor());
}
UNMAP_AFTER_INIT KResult FramebufferDevice::initialize()
{
// FIXME: Would be nice to be able to unify this with mmap above, but this

View file

@ -25,10 +25,6 @@ public:
virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
// ^Device
virtual mode_t required_mode() const override { return 0660; }
virtual String device_name() const override;
virtual void deactivate_writes();
virtual void activate_writes();
size_t framebuffer_size_in_bytes() const;

View file

@ -68,9 +68,6 @@ private:
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; };
virtual void start_request(AsyncBlockDeviceRequest& request) override { request.complete(AsyncDeviceRequest::Failure); }
virtual mode_t required_mode() const override { return 0666; }
virtual String device_name() const override { return String::formatted("fb{}", minor()); }
static bool is_valid_buffer_index(int buffer_index)
{
return buffer_index == 0 || buffer_index == 1;