Skip to content

Commit 3689d3d

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: device property: Switch to use new generic UUID API
There are new types and helpers that are supposed to be used in new code. As a preparation to get rid of legacy types and API functions do the conversion here. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b6eb66f commit 3689d3d

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

drivers/acpi/property.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ static int acpi_data_get_property_array(const struct acpi_device_data *data,
2424
acpi_object_type type,
2525
const union acpi_object **obj);
2626

27-
/* ACPI _DSD device properties UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
28-
static const u8 prp_uuid[16] = {
29-
0x14, 0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d,
30-
0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01
31-
};
32-
/* ACPI _DSD data subnodes UUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
33-
static const u8 ads_uuid[16] = {
34-
0xe6, 0xe3, 0xb8, 0xdb, 0x86, 0x58, 0xa6, 0x4b,
35-
0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b
36-
};
27+
/* ACPI _DSD device properties GUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
28+
static const guid_t prp_guid =
29+
GUID_INIT(0xdaffd814, 0x6eba, 0x4d8c,
30+
0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01);
31+
/* ACPI _DSD data subnodes GUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
32+
static const guid_t ads_guid =
33+
GUID_INIT(0xdbb8e3e6, 0x5886, 0x4ba6,
34+
0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b);
3735

3836
static bool acpi_enumerate_nondev_subnodes(acpi_handle scope,
3937
const union acpi_object *desc,
@@ -189,22 +187,23 @@ static bool acpi_enumerate_nondev_subnodes(acpi_handle scope,
189187
{
190188
int i;
191189

192-
/* Look for the ACPI data subnodes UUID. */
190+
/* Look for the ACPI data subnodes GUID. */
193191
for (i = 0; i < desc->package.count; i += 2) {
194-
const union acpi_object *uuid, *links;
192+
const union acpi_object *guid, *links;
195193

196-
uuid = &desc->package.elements[i];
194+
guid = &desc->package.elements[i];
197195
links = &desc->package.elements[i + 1];
198196

199197
/*
200-
* The first element must be a UUID and the second one must be
198+
* The first element must be a GUID and the second one must be
201199
* a package.
202200
*/
203-
if (uuid->type != ACPI_TYPE_BUFFER || uuid->buffer.length != 16
204-
|| links->type != ACPI_TYPE_PACKAGE)
201+
if (guid->type != ACPI_TYPE_BUFFER ||
202+
guid->buffer.length != 16 ||
203+
links->type != ACPI_TYPE_PACKAGE)
205204
break;
206205

207-
if (memcmp(uuid->buffer.pointer, ads_uuid, sizeof(ads_uuid)))
206+
if (!guid_equal((guid_t *)guid->buffer.pointer, &ads_guid))
208207
continue;
209208

210209
return acpi_add_nondev_subnodes(scope, links, &data->subnodes,
@@ -297,26 +296,27 @@ static bool acpi_extract_properties(const union acpi_object *desc,
297296
if (desc->package.count % 2)
298297
return false;
299298

300-
/* Look for the device properties UUID. */
299+
/* Look for the device properties GUID. */
301300
for (i = 0; i < desc->package.count; i += 2) {
302-
const union acpi_object *uuid, *properties;
301+
const union acpi_object *guid, *properties;
303302

304-
uuid = &desc->package.elements[i];
303+
guid = &desc->package.elements[i];
305304
properties = &desc->package.elements[i + 1];
306305

307306
/*
308-
* The first element must be a UUID and the second one must be
307+
* The first element must be a GUID and the second one must be
309308
* a package.
310309
*/
311-
if (uuid->type != ACPI_TYPE_BUFFER || uuid->buffer.length != 16
312-
|| properties->type != ACPI_TYPE_PACKAGE)
310+
if (guid->type != ACPI_TYPE_BUFFER ||
311+
guid->buffer.length != 16 ||
312+
properties->type != ACPI_TYPE_PACKAGE)
313313
break;
314314

315-
if (memcmp(uuid->buffer.pointer, prp_uuid, sizeof(prp_uuid)))
315+
if (!guid_equal((guid_t *)guid->buffer.pointer, &prp_guid))
316316
continue;
317317

318318
/*
319-
* We found the matching UUID. Now validate the format of the
319+
* We found the matching GUID. Now validate the format of the
320320
* package immediately following it.
321321
*/
322322
if (!acpi_properties_format_valid(properties))

0 commit comments

Comments
 (0)