diff options
author | Liav A <liavalb@gmail.com> | 2021-12-23 20:08:18 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-23 23:02:39 +0100 |
commit | 9eb08bdb0f7460eb9874a5d16f6f3808f3d8a8f0 (patch) | |
tree | 79c20875f3cd0977fc809964f2e5f7a771ce1428 /Kernel/Storage/ATA/ATAPIDiscDevice.cpp | |
parent | 6d149400534643d2d4549853b257c136c3a8d47c (diff) | |
download | serenity-9eb08bdb0f7460eb9874a5d16f6f3808f3d8a8f0.zip |
Kernel: Make major and minor numbers to be DistinctNumerics
This helps avoid confusion in general, and make constructors, methods
and code patterns much more clean and understandable.
Diffstat (limited to 'Kernel/Storage/ATA/ATAPIDiscDevice.cpp')
-rw-r--r-- | Kernel/Storage/ATA/ATAPIDiscDevice.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp index 7c60f54a14..984312bf08 100644 --- a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp +++ b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp @@ -16,19 +16,19 @@ namespace Kernel { NonnullRefPtr<ATAPIDiscDevice> ATAPIDiscDevice::create(const ATAController& controller, ATADevice::Address ata_address, u16 capabilities, u64 max_addressable_block) { - auto minor_device_number = StorageManagement::minor_number(); + auto minor_device_number = StorageManagement::generate_storage_minor_number(); // FIXME: We need a way of formatting strings with KString. - auto device_name = String::formatted("hd{:c}", 'a' + minor_device_number); + auto device_name = String::formatted("hd{:c}", 'a' + minor_device_number.value()); auto device_name_kstring = KString::must_create(device_name.view()); - auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number, capabilities, max_addressable_block, move(device_name_kstring)); + auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name_kstring)); // FIXME: Find a way to propagate errors VERIFY(!disc_device_or_error.is_error()); return disc_device_or_error.release_value(); } -ATAPIDiscDevice::ATAPIDiscDevice(const ATAController& controller, ATADevice::Address ata_address, unsigned minor_number, u16 capabilities, u64 max_addressable_block, NonnullOwnPtr<KString> early_storage_name) +ATAPIDiscDevice::ATAPIDiscDevice(const ATAController& controller, ATADevice::Address ata_address, MinorNumber minor_number, u16 capabilities, u64 max_addressable_block, NonnullOwnPtr<KString> early_storage_name) : ATADevice(controller, ata_address, minor_number, capabilities, 0, max_addressable_block, move(early_storage_name)) { } |