diff options
author | 2021-01-29 16:28:48 +0100 | |
---|---|---|
committer | 2021-01-29 16:28:48 +0100 | |
commit | b584b7e9630acc65a4d01ff5f9090d1a0fb3bbb6 (patch) | |
tree | 2f963f99bc44ea4034aaf56855979796beab9425 | |
parent | ACPI: thermal: Do not call acpi_thermal_check() directly (diff) | |
parent | ACPI: sysfs: Prefer "compatible" modalias (diff) | |
download | linux-b584b7e9630acc65a4d01ff5f9090d1a0fb3bbb6.tar.gz linux-b584b7e9630acc65a4d01ff5f9090d1a0fb3bbb6.tar.bz2 linux-b584b7e9630acc65a4d01ff5f9090d1a0fb3bbb6.zip |
Merge branch 'acpi-sysfs'
* acpi-sysfs:
ACPI: sysfs: Prefer "compatible" modalias
-rw-r--r-- | drivers/acpi/device_sysfs.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 96869f1538b9..bfca116482b8 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -251,20 +251,12 @@ int __acpi_device_uevent_modalias(struct acpi_device *adev, if (add_uevent_var(env, "MODALIAS=")) return -ENOMEM; - len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], - sizeof(env->buf) - env->buflen); - if (len < 0) - return len; - - env->buflen += len; - if (!adev->data.of_compatible) - return 0; - - if (len > 0 && add_uevent_var(env, "MODALIAS=")) - return -ENOMEM; - - len = create_of_modalias(adev, &env->buf[env->buflen - 1], - sizeof(env->buf) - env->buflen); + if (adev->data.of_compatible) + len = create_of_modalias(adev, &env->buf[env->buflen - 1], + sizeof(env->buf) - env->buflen); + else + len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], + sizeof(env->buf) - env->buflen); if (len < 0) return len; |