Merge tag 'efi-urgent-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI fix from Borislav Petkov:
"A single fix from Lukas: handle boolean device properties imported
from Apple firmware correctly"

* tag 'efi-urgent-for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efi/apple-properties: Reinstate support for boolean properties

Changed files
+9 -4
drivers
firmware
+9 -4
drivers/firmware/efi/apple-properties.c
··· 3 3 * apple-properties.c - EFI device properties on Macs 4 4 * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de> 5 5 * 6 - * Note, all properties are considered as u8 arrays. 7 - * To get a value of any of them the caller must use device_property_read_u8_array(). 6 + * Properties are stored either as: 7 + * u8 arrays which can be retrieved with device_property_read_u8_array() or 8 + * booleans which can be queried with device_property_present(). 8 9 */ 9 10 10 11 #define pr_fmt(fmt) "apple-properties: " fmt ··· 89 88 90 89 entry_data = ptr + key_len + sizeof(val_len); 91 90 entry_len = val_len - sizeof(val_len); 92 - entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data, 93 - entry_len); 91 + if (entry_len) 92 + entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data, 93 + entry_len); 94 + else 95 + entry[i] = PROPERTY_ENTRY_BOOL(key); 96 + 94 97 if (dump_properties) { 95 98 dev_info(dev, "property: %s\n", key); 96 99 print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,