diff mbox series

hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method

Message ID 20241112021228.22914-1-lihuisong@huawei.com (mailing list archive)
State Accepted
Headers show
Series hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method | expand

Commit Message

lihuisong (C) Nov. 12, 2024, 2:12 a.m. UTC
As ACPI spec said, _PMD method is optional. The acpi_power_meter
shouldn't fail to load when the platform hasn't _PMD method.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/hwmon/acpi_power_meter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Guenter Roeck Nov. 12, 2024, 3:29 a.m. UTC | #1
On Tue, Nov 12, 2024 at 10:12:28AM +0800, Huisong Li wrote:
> As ACPI spec said, _PMD method is optional. The acpi_power_meter
> shouldn't fail to load when the platform hasn't _PMD method.
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>

Applied.

Thanks,
Guenter
diff mbox series

Patch

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) {