aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 03141aa4ea95..0a099917a006 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -135,12 +135,13 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
135 struct acpi_hardware_id *id; 135 struct acpi_hardware_id *id;
136 136
137 /* 137 /*
138 * Since we skip PRP0001 from the modalias below, 0 should be returned 138 * Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should
139 * if PRP0001 is the only ACPI/PNP ID in the device's list. 139 * be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the
140 * device's list.
140 */ 141 */
141 count = 0; 142 count = 0;
142 list_for_each_entry(id, &acpi_dev->pnp.ids, list) 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 count++; 145 count++;
145 146
146 if (!count) 147 if (!count)
@@ -153,7 +154,7 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
153 size -= len; 154 size -= len;
154 155
155 list_for_each_entry(id, &acpi_dev->pnp.ids, list) { 156 list_for_each_entry(id, &acpi_dev->pnp.ids, list) {
156 if (!strcmp(id->id, "PRP0001")) 157 if (!strcmp(id->id, ACPI_DT_NAMESPACE_HID))
157 continue; 158 continue;
158 159
159 count = snprintf(&modalias[len], size, "%s:", id->id); 160 count = snprintf(&modalias[len], size, "%s:", id->id);
@@ -177,7 +178,8 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
177 * @size: Size of the buffer. 178 * @size: Size of the buffer.
178 * 179 *
179 * Expose DT compatible modalias as of:NnameTCcompatible. This function should 180 * Expose DT compatible modalias as of:NnameTCcompatible. This function should
180 * only be called for devices having PRP0001 in their list of ACPI/PNP IDs. 181 * only be called for devices having ACPI_DT_NAMESPACE_HID in their list of
182 * ACPI/PNP IDs.
181 */ 183 */
182static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias, 184static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias,
183 int size) 185 int size)
@@ -980,9 +982,9 @@ static void acpi_device_remove_files(struct acpi_device *dev)
980 * @adev: ACPI device object to match. 982 * @adev: ACPI device object to match.
981 * @of_match_table: List of device IDs to match against. 983 * @of_match_table: List of device IDs to match against.
982 * 984 *
983 * If @dev has an ACPI companion which has the special PRP0001 device ID in its 985 * If @dev has an ACPI companion which has ACPI_DT_NAMESPACE_HID in its list of
984 * list of identifiers and a _DSD object with the "compatible" property, use 986 * identifiers and a _DSD object with the "compatible" property, use that
985 * that property to match against the given list of identifiers. 987 * property to match against the given list of identifiers.
986 */ 988 */
987static bool acpi_of_match_device(struct acpi_device *adev, 989static bool acpi_of_match_device(struct acpi_device *adev,
988 const struct of_device_id *of_match_table) 990 const struct of_device_id *of_match_table)
@@ -1038,14 +1040,14 @@ static const struct acpi_device_id *__acpi_match_device(
1038 return id; 1040 return id;
1039 1041
1040 /* 1042 /*
1041 * Next, check the special "PRP0001" ID and try to match the 1043 * Next, check ACPI_DT_NAMESPACE_HID and try to match the
1042 * "compatible" property if found. 1044 * "compatible" property if found.
1043 * 1045 *
1044 * The id returned by the below is not valid, but the only 1046 * The id returned by the below is not valid, but the only
1045 * caller passing non-NULL of_ids here is only interested in 1047 * caller passing non-NULL of_ids here is only interested in
1046 * whether or not the return value is NULL. 1048 * whether or not the return value is NULL.
1047 */ 1049 */
1048 if (!strcmp("PRP0001", hwid->id) 1050 if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id)
1049 && acpi_of_match_device(device, of_ids)) 1051 && acpi_of_match_device(device, of_ids))
1050 return id; 1052 return id;
1051 } 1053 }
@@ -1671,7 +1673,7 @@ static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
1671 1673
1672static void acpi_wakeup_gpe_init(struct acpi_device *device) 1674static void acpi_wakeup_gpe_init(struct acpi_device *device)
1673{ 1675{
1674 struct acpi_device_id button_device_ids[] = { 1676 static const struct acpi_device_id button_device_ids[] = {
1675 {"PNP0C0C", 0}, 1677 {"PNP0C0C", 0},
1676 {"PNP0C0D", 0}, 1678 {"PNP0C0D", 0},
1677 {"PNP0C0E", 0}, 1679 {"PNP0C0E", 0},
@@ -2405,7 +2407,7 @@ static void acpi_default_enumeration(struct acpi_device *device)
2405} 2407}
2406 2408
2407static const struct acpi_device_id generic_device_ids[] = { 2409static const struct acpi_device_id generic_device_ids[] = {
2408 {"PRP0001", }, 2410 {ACPI_DT_NAMESPACE_HID, },
2409 {"", }, 2411 {"", },
2410}; 2412};
2411 2413
@@ -2413,8 +2415,8 @@ static int acpi_generic_device_attach(struct acpi_device *adev,
2413 const struct acpi_device_id *not_used) 2415 const struct acpi_device_id *not_used)
2414{ 2416{
2415 /* 2417 /*
2416 * Since PRP0001 is the only ID handled here, the test below can be 2418 * Since ACPI_DT_NAMESPACE_HID is the only ID handled here, the test
2417 * unconditional. 2419 * below can be unconditional.
2418 */ 2420 */
2419 if (adev->data.of_compatible) 2421 if (adev->data.of_compatible)
2420 acpi_default_enumeration(adev); 2422 acpi_default_enumeration(adev);