From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hansg@kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
Date: Mon, 06 Jul 2026 14:35:51 +0200 [thread overview]
Message-ID: <2297496.irdbgypaU6@rafael.j.wysocki> (raw)
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
The driver populates acpi_device_name() and acpi_device_class() that are
never read afterward, so make it stop doing that and drop the symbols
defined for this purpose.
Since ACPI_POWER_METER_CLASS is also used for generating ACPI netlink
events, use the "pwr_meter_resource" string literal directly instead of
it for that.
No intentional functional impact.
This will facilitate the removal of device_name and device_class from
struct acpi_device_pnp in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/hwmon/acpi_power_meter.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 0c9b9f4180fb..8a539e8d1334 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -21,8 +21,6 @@
#include <linux/platform_device.h>
#define ACPI_POWER_METER_NAME "power_meter"
-#define ACPI_POWER_METER_DEVICE_NAME "Power Meter"
-#define ACPI_POWER_METER_CLASS "pwr_meter_resource"
#define NUM_SENSORS 17
@@ -877,7 +875,7 @@ static void acpi_power_meter_notify(acpi_handle handle, u32 event, void *data)
break;
}
- acpi_bus_generate_netlink_event(ACPI_POWER_METER_CLASS,
+ acpi_bus_generate_netlink_event("pwr_meter_resource",
dev_name(&resource->acpi_dev->dev),
event, 0);
}
@@ -899,8 +897,6 @@ static int acpi_power_meter_probe(struct platform_device *pdev)
resource->sensors_valid = 0;
resource->acpi_dev = device;
mutex_init(&resource->lock);
- strscpy(acpi_device_name(device), ACPI_POWER_METER_DEVICE_NAME);
- strscpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);
platform_set_drvdata(pdev, resource);
--
2.51.0
next reply other threads:[~2026-07-06 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 12:35 Rafael J. Wysocki [this message]
2026-07-06 13:50 ` [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class() Guenter Roeck
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=2297496.irdbgypaU6@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hansg@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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