diff options
| -rw-r--r-- | drivers/pci/pcie/aspm.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index c687c817b47d..5326916715d2 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
| @@ -1127,11 +1127,9 @@ static int pcie_aspm_set_policy(const char *val, | |||
| 1127 | 1127 | ||
| 1128 | if (aspm_disabled) | 1128 | if (aspm_disabled) |
| 1129 | return -EPERM; | 1129 | return -EPERM; |
| 1130 | for (i = 0; i < ARRAY_SIZE(policy_str); i++) | 1130 | i = sysfs_match_string(policy_str, val); |
| 1131 | if (!strncmp(val, policy_str[i], strlen(policy_str[i]))) | 1131 | if (i < 0) |
| 1132 | break; | 1132 | return i; |
| 1133 | if (i >= ARRAY_SIZE(policy_str)) | ||
| 1134 | return -EINVAL; | ||
| 1135 | if (i == aspm_policy) | 1133 | if (i == aspm_policy) |
| 1136 | return 0; | 1134 | return 0; |
| 1137 | 1135 | ||
