]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method
authorHuisong Li <lihuisong@huawei.com>
Tue, 12 Nov 2024 02:12:28 +0000 (10:12 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 12 Nov 2024 21:54:55 +0000 (13:54 -0800)
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>
drivers/hwmon/acpi_power_meter.c

index 6c8a9c863528ed3f3d77ec37054da71d26dd31f1..2f1c9d97ad2118537355638b13fae948e8a82110 100644 (file)
@@ -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) {