From: Huisong Li <lihuisong@huawei.com>
To: <linux-pm@vger.kernel.org>, <rafael@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <liuyonglong@huawei.com>,
<zhanjie9@hisilicon.com>, <lihuisong@huawei.com>
Subject: [PATCH v1 2/2] hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method
Date: Thu, 7 Nov 2024 11:26:26 +0800 [thread overview]
Message-ID: <20241107032626.16682-3-lihuisong@huawei.com> (raw)
In-Reply-To: <20241107032626.16682-1-lihuisong@huawei.com>
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(-)
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) {
--
2.22.0
next prev parent reply other threads:[~2024-11-07 3:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 3:26 [PATCH v1 0/2] Add _TZD method for ACPI thermal Huisong Li
2024-11-07 3:26 ` [PATCH v1 1/2] ACPI: thermal: Support for linking devices associated with the thermal zone Huisong Li
2024-11-07 3:26 ` Huisong Li [this message]
2024-11-07 10:55 ` [PATCH v1 2/2] hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method Rafael J. Wysocki
2024-11-07 12:07 ` lihuisong (C)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241107032626.16682-3-lihuisong@huawei.com \
--to=lihuisong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=rafael@kernel.org \
--cc=zhanjie9@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®