Skip to content

Commit 8d6bf2e

Browse files
Kazuhiro-Abe-fjgroeck
authored andcommitted
hwmon: (acpi_power_meter) Fix a check for the return value of read_domain_devices().
After commit fabb1f8 ("hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method"), the acpi_power_meter driver fails to load if the platform has _PMD method. To address this, add a check for successful read_domain_devices(). Tested on Nvidia Grace machine. Fixes: fabb1f8 ("hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method") Signed-off-by: Kazuhiro Abe <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Dropped unnecessary () from expression] Signed-off-by: Guenter Roeck <[email protected]>
1 parent e2c68ce commit 8d6bf2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/acpi_power_meter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
682682

683683
/* _PMD method is optional. */
684684
res = read_domain_devices(resource);
685-
if (res != -ENODEV)
685+
if (res && res != -ENODEV)
686686
return res;
687687

688688
if (resource->caps.flags & POWER_METER_CAN_MEASURE) {

0 commit comments

Comments
 (0)