hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
Subsystems (2)
Rafael J. Wysocki
maintainerPATCH 1/1 hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
From: "Rafael J. Wysocki" <[email protected]>
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.
--- drivers/hwmon/acpi_power_meter.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/hwmon/acpi_power_meter.c +1 -5
@@ -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);
Signature · 1 line
2.51.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines
From: "Rafael J. Wysocki" <[email protected]>
The driver populates
acpi_device_name()andacpi_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_CLASSis also used for generating ACPI netlink events, use the "pwr_meter_resource" string literal directly instead of it for that.
Quoted 6 lines
No intentional functional impact.
This will facilitate the removal of
device_nameanddevice_classfrom structacpi_device_pnpin the future.Signed-off-by Rafael J. Wysocki <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 10 lines · Rafael J. Wysocki
From: "Rafael J. Wysocki" <[email protected]>
The driver populates
acpi_device_name()andacpi_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_CLASSis also used for generating ACPI netlink events, use the "pwr_meter_resource" string literal directly instead of it for that.
Quoted 6 lines
No intentional functional impact.
This will facilitate the removal of
device_nameanddevice_classfrom structacpi_device_pnpin the future.Signed-off-by Rafael J. Wysocki <[email protected]>
Applied.
Thanks,
Guenter