Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / property: Define a symbol for PRP0001

Use a #defined symbol ACPI_DT_NAMESPACE_HID instead of the PRP0001
string.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>

+21 -17
+2
drivers/acpi/internal.h
··· 191 191 /*-------------------------------------------------------------------------- 192 192 Device properties 193 193 -------------------------------------------------------------------------- */ 194 + #define ACPI_DT_NAMESPACE_HID "PRP0001" 195 + 194 196 void acpi_init_properties(struct acpi_device *adev); 195 197 void acpi_free_properties(struct acpi_device *adev); 196 198
+4 -4
drivers/acpi/property.c
··· 110 110 int i; 111 111 112 112 /* 113 - * Check if the special PRP0001 ACPI ID is present and in that case we 114 - * fill in Device Tree compatible properties for this device. 113 + * Check if ACPI_DT_NAMESPACE_HID is present and inthat case we fill in 114 + * Device Tree compatible properties for this device. 115 115 */ 116 116 list_for_each_entry(hwid, &adev->pnp.ids, list) { 117 - if (!strcmp(hwid->id, "PRP0001")) { 117 + if (!strcmp(hwid->id, ACPI_DT_NAMESPACE_HID)) { 118 118 acpi_of = true; 119 119 break; 120 120 } ··· 170 170 out: 171 171 if (acpi_of && !adev->flags.of_compatible_ok) 172 172 acpi_handle_info(adev->handle, 173 - "PRP0001 requires 'compatible' property\n"); 173 + ACPI_DT_NAMESPACE_HID " requires 'compatible' property\n"); 174 174 } 175 175 176 176 void acpi_free_properties(struct acpi_device *adev)
+15 -13
drivers/acpi/scan.c
··· 135 135 struct acpi_hardware_id *id; 136 136 137 137 /* 138 - * Since we skip PRP0001 from the modalias below, 0 should be returned 139 - * if PRP0001 is the only ACPI/PNP ID in the device's list. 138 + * Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should 139 + * be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the 140 + * device's list. 140 141 */ 141 142 count = 0; 142 143 list_for_each_entry(id, &acpi_dev->pnp.ids, list) 143 - if (strcmp(id->id, "PRP0001")) 144 + if (strcmp(id->id, ACPI_DT_NAMESPACE_HID)) 144 145 count++; 145 146 146 147 if (!count) ··· 154 153 size -= len; 155 154 156 155 list_for_each_entry(id, &acpi_dev->pnp.ids, list) { 157 - if (!strcmp(id->id, "PRP0001")) 156 + if (!strcmp(id->id, ACPI_DT_NAMESPACE_HID)) 158 157 continue; 159 158 160 159 count = snprintf(&modalias[len], size, "%s:", id->id); ··· 178 177 * @size: Size of the buffer. 179 178 * 180 179 * Expose DT compatible modalias as of:NnameTCcompatible. This function should 181 - * only be called for devices having PRP0001 in their list of ACPI/PNP IDs. 180 + * only be called for devices having ACPI_DT_NAMESPACE_HID in their list of 181 + * ACPI/PNP IDs. 182 182 */ 183 183 static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias, 184 184 int size) ··· 982 980 * @adev: ACPI device object to match. 983 981 * @of_match_table: List of device IDs to match against. 984 982 * 985 - * If @dev has an ACPI companion which has the special PRP0001 device ID in its 986 - * list of identifiers and a _DSD object with the "compatible" property, use 987 - * that property to match against the given list of identifiers. 983 + * If @dev has an ACPI companion which has ACPI_DT_NAMESPACE_HID in its list of 984 + * identifiers and a _DSD object with the "compatible" property, use that 985 + * property to match against the given list of identifiers. 988 986 */ 989 987 static bool acpi_of_match_device(struct acpi_device *adev, 990 988 const struct of_device_id *of_match_table) ··· 1040 1038 return id; 1041 1039 1042 1040 /* 1043 - * Next, check the special "PRP0001" ID and try to match the 1041 + * Next, check ACPI_DT_NAMESPACE_HID and try to match the 1044 1042 * "compatible" property if found. 1045 1043 * 1046 1044 * The id returned by the below is not valid, but the only 1047 1045 * caller passing non-NULL of_ids here is only interested in 1048 1046 * whether or not the return value is NULL. 1049 1047 */ 1050 - if (!strcmp("PRP0001", hwid->id) 1048 + if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id) 1051 1049 && acpi_of_match_device(device, of_ids)) 1052 1050 return id; 1053 1051 } ··· 2407 2405 } 2408 2406 2409 2407 static const struct acpi_device_id generic_device_ids[] = { 2410 - {"PRP0001", }, 2408 + {ACPI_DT_NAMESPACE_HID, }, 2411 2409 {"", }, 2412 2410 }; 2413 2411 ··· 2415 2413 const struct acpi_device_id *not_used) 2416 2414 { 2417 2415 /* 2418 - * Since PRP0001 is the only ID handled here, the test below can be 2419 - * unconditional. 2416 + * Since ACPI_DT_NAMESPACE_HID is the only ID handled here, the test 2417 + * below can be unconditional. 2420 2418 */ 2421 2419 if (adev->data.of_compatible) 2422 2420 acpi_default_enumeration(adev);