diff options
author | Rafael J. Wysocki | 2021-01-29 16:28:48 +0100 |
---|---|---|
committer | Rafael J. Wysocki | 2021-01-29 16:28:48 +0100 |
commit | b584b7e9630acc65a4d01ff5f9090d1a0fb3bbb6 (patch) | |
tree | 2f963f99bc44ea4034aaf56855979796beab9425 /drivers/acpi | |
parent | 81b704d3e4674e09781d331df73d76675d5ad8cb (diff) | |
parent | 36af2d5c4433fb40ee2af912c4ac0a30991aecfc (diff) |
Merge branch 'acpi-sysfs'
* acpi-sysfs:
ACPI: sysfs: Prefer "compatible" modalias
Diffstat (limited to 'drivers/acpi')
-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; |