diff options
author | Huisong Li <lihuisong@huawei.com> | 2024-11-12 05:12:28 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2024-11-13 00:54:55 +0300 |
commit | fabb1f813ec05975fd3428e72a62ef9f855fd3b4 (patch) | |
tree | f560c2c98c88e81f6f3e509fcc7fe1b8b15e72cc | |
parent | 57ee12b6c514146c19b6a159013b48727a012960 (diff) | |
download | linux-fabb1f813ec05975fd3428e72a62ef9f855fd3b4.tar.xz |
hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method
According to the ACPI specification, the _PMD method is optional. The
acpi_power_meter driver shouldn't fail to load if the platform has no
_PMD method.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Message-ID: <20241112021228.22914-1-lihuisong@huawei.com>
[groeck: Reworded commit description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index 6c8a9c863528..2f1c9d97ad21 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -680,8 +680,9 @@ static int setup_attrs(struct acpi_power_meter_resource *resource) { int res = 0; + /* _PMD method is optional. */ res = read_domain_devices(resource); - if (res) + if (res != -ENODEV) return res; if (resource->caps.flags & POWER_METER_CAN_MEASURE) { |