File locking refactored (#631)

Remove FileMutex and wire locking into driver subsystems.
This commit is contained in:
Ken Van Hoeylandt
2026-08-28 01:06:53 +02:00
committed by GitHub
parent 92ca046681
commit 020aa471e2
44 changed files with 766 additions and 993 deletions
@@ -22,6 +22,22 @@ error_t spi_controller_unlock(Device* device) {
return SPI_DRIVER_API(driver)->unlock(device);
}
error_t spi_controller_lock_bus_of(Device* device) {
Device* parent = device_get_parent(device);
if (parent == nullptr || device_get_type(parent) != &SPI_CONTROLLER_TYPE) {
return ERROR_NONE;
}
return spi_controller_lock(parent);
}
void spi_controller_unlock_bus_of(Device* device) {
Device* parent = device_get_parent(device);
if (parent == nullptr || device_get_type(parent) != &SPI_CONTROLLER_TYPE) {
return;
}
spi_controller_unlock(parent);
}
const DeviceType SPI_CONTROLLER_TYPE {
.name = "spi-controller"
};