* [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
@ 2026-07-06 12:35 Rafael J. Wysocki
2026-07-06 12:39 ` sashiko-bot
2026-07-06 13:50 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-07-06 12:35 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-hwmon, Andy Shevchenko, Hans de Goede, Linux ACPI, LKML
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
2026-07-06 12:35 [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class() Rafael J. Wysocki
@ 2026-07-06 12:39 ` sashiko-bot
2026-07-06 13:50 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-06 12:39 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-hwmon
> 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>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/2297496.irdbgypaU6@rafael.j.wysocki?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
2026-07-06 12:35 [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class() Rafael J. Wysocki
2026-07-06 12:39 ` sashiko-bot
@ 2026-07-06 13:50 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-07-06 13:50 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-hwmon, Andy Shevchenko, Hans de Goede, Linux ACPI, LKML
On Mon, Jul 06, 2026 at 02:35:51PM +0200, Rafael J. Wysocki wrote:
> 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>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-06 13:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 12:35 [PATCH v1] hwmon: (acpi_power_meter) Stop setting acpi_device_name/class() Rafael J. Wysocki
2026-07-06 12:39 ` sashiko-bot
2026-07-06 13:50 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.