mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 16:06:04 -05:00
hwmon: (acpi_power_meter) Fix a check for the return value of read_domain_devices().
After commitfabb1f813e
("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:fabb1f813e
("hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method") Signed-off-by: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com> Link: https://lore.kernel.org/r/20250115073532.3211000-1-fj1078ii@aa.jp.fujitsu.com [groeck: Dropped unnecessary () from expression] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
e2c68cea43
commit
8d6bf2e105
1 changed files with 1 additions and 1 deletions
|
@ -682,7 +682,7 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
|
|||
|
||||
/* _PMD method is optional. */
|
||||
res = read_domain_devices(resource);
|
||||
if (res != -ENODEV)
|
||||
if (res && res != -ENODEV)
|
||||
return res;
|
||||
|
||||
if (resource->caps.flags & POWER_METER_CAN_MEASURE) {
|
||||
|
|
Loading…
Reference in a new issue