mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 06:48:09 -08:00
Compare commits
2 Commits
804ea632af
...
bd772896c2
Author | SHA1 | Date | |
---|---|---|---|
|
bd772896c2 | ||
|
fa5f66da59 |
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal file
@ -59,11 +59,17 @@ assert_cc(offsetof(Device, fw.name_offset) == 20);
|
|||||||
assert_cc(offsetof(Device, fw.compatible_offset) == 24);
|
assert_cc(offsetof(Device, fw.compatible_offset) == 24);
|
||||||
assert_cc(sizeof(Device) == 28);
|
assert_cc(sizeof(Device) == 28);
|
||||||
|
|
||||||
static inline const char* device_get_name(const void *base, const Device *device) {
|
static inline const char* device_get_devicetree_name(const void *base, const Device *device) {
|
||||||
|
if (device->descriptor != DEVICE_DESCRIPTOR_DEVICETREE)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return device->devicetree.name_offset == 0 ? NULL : (const char *) ((const uint8_t *) base + device->devicetree.name_offset);
|
return device->devicetree.name_offset == 0 ? NULL : (const char *) ((const uint8_t *) base + device->devicetree.name_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char* device_get_compatible(const void *base, const Device *device) {
|
static inline const char* device_get_devicetree_compatible(const void *base, const Device *device) {
|
||||||
|
if (device->descriptor != DEVICE_DESCRIPTOR_DEVICETREE)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return device->devicetree.compatible_offset == 0 ? NULL : (const char *) ((const uint8_t *) base + device->devicetree.compatible_offset);
|
return device->devicetree.compatible_offset == 0 ? NULL : (const char *) ((const uint8_t *) base + device->devicetree.compatible_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "devicetree",
|
|
||||||
"name": "Device 1",
|
"name": "Device 1",
|
||||||
"compatible": "test,device-1",
|
"compatible": "test,device-1",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "firmware",
|
|
||||||
"name": "Device 2",
|
"name": "Device 2",
|
||||||
"compatible": "test,device-2",
|
"compatible": "test,device-2",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "devicetree",
|
|
||||||
"name": "Device 3",
|
"name": "Device 3",
|
||||||
"compatible": "test,device-3",
|
"compatible": "test,device-3",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
|
@ -185,7 +185,7 @@ static bool pe_use_this_dtb(
|
|||||||
if (!device || !base)
|
if (!device || !base)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char *compatible = device_get_compatible(base, device);
|
const char *compatible = device_get_devicetree_compatible(base, device);
|
||||||
if (!compatible)
|
if (!compatible)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user