OSDN Git Service

ACPI / bus: Leave modalias empty for devices which are not present
authorHans de Goede <hdegoede@redhat.com>
Sun, 15 Oct 2017 19:24:49 +0000 (21:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Nov 2017 22:48:51 +0000 (23:48 +0100)
commit10809bb976648ac58194a629e3d7af99e7400297
treedff24c4039d490ce213ee87009763200e830dac3
parent190b10367b0d311f68dc71e40b254fd4427affc2
ACPI / bus: Leave modalias empty for devices which are not present

Most Bay and Cherry Trail devices use a generic DSDT with all possible
peripheral devices present in the DSDT, with their _STA returning 0x00 or
0x0f based on AML variables which describe what is actually present on
the board.

Since ACPI device objects with a 0x00 status (not present) still get an
entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID
modalias, userspace would end up loading modules for non present hardware.

This commit fixes this by leaving the modalias empty for non present
devices. This results in 10 modules less being loaded with a generic
distro kernel config on my Cherry Trail test-device (a GPD pocket).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_sysfs.c