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