Kernel: Give PTY's *actually* unique major ID's

Okay, one "dunce hat" point for me. The new PTY majors conflicted with
PATAChannel. Now they are 200 for master and 201 for slave, not used
by anything else.. I hope!
This commit is contained in:
Andreas Kling 2019-12-09 21:03:39 +01:00
commit e9dda8d592
Notes: sideshowbarker 2024-07-19 10:54:20 +09:00
4 changed files with 7 additions and 3 deletions

View file

@ -30,6 +30,10 @@ Device::Device(unsigned major, unsigned minor)
, m_minor(minor)
{
u32 device_id = encoded_device(major, minor);
auto it = all_devices().find(device_id);
if (it != all_devices().end()) {
dbg() << "Already registered " << major << "," << minor << ": " << it->value->class_name();
}
ASSERT(!all_devices().contains(device_id));
all_devices().set(device_id, this);
}