Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / battery: move some ACPI_BATTERY_* definitions to header

ACPI_BATTERY_CLASS is used in multiple places.
Also, I'll use ACPI_BATTERY_NOTIFY_STATUS inside AC driver in
one of following patches.

So, create a header file and move ACPI_BATTERY_CLASS and
ACPI_BATTERY_NOTIFY_* definitions into it.
Also, remove copy of ACPI_BATTERY_CLASS from sbs.c

Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Alexander Mezin and committed by
Rafael J. Wysocki
f03be352 dcb99fd9

+13 -5
+2 -4
drivers/acpi/battery.c
··· 39 39 #include <linux/acpi.h> 40 40 #include <linux/power_supply.h> 41 41 42 + #include "battery.h" 43 + 42 44 #define PREFIX "ACPI: " 43 45 44 46 #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF 45 47 46 - #define ACPI_BATTERY_CLASS "battery" 47 48 #define ACPI_BATTERY_DEVICE_NAME "Battery" 48 - #define ACPI_BATTERY_NOTIFY_STATUS 0x80 49 - #define ACPI_BATTERY_NOTIFY_INFO 0x81 50 - #define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82 51 49 52 50 /* Battery power unit: 0 means mW, 1 means mA */ 53 51 #define ACPI_BATTERY_POWER_UNIT_MA 1
+10
drivers/acpi/battery.h
··· 1 + #ifndef __ACPI_BATTERY_H 2 + #define __ACPI_BATTERY_H 3 + 4 + #define ACPI_BATTERY_CLASS "battery" 5 + 6 + #define ACPI_BATTERY_NOTIFY_STATUS 0x80 7 + #define ACPI_BATTERY_NOTIFY_INFO 0x81 8 + #define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82 9 + 10 + #endif
+1 -1
drivers/acpi/sbs.c
··· 37 37 #include <linux/power_supply.h> 38 38 39 39 #include "sbshc.h" 40 + #include "battery.h" 40 41 41 42 #define PREFIX "ACPI: " 42 43 43 44 #define ACPI_SBS_CLASS "sbs" 44 45 #define ACPI_AC_CLASS "ac_adapter" 45 - #define ACPI_BATTERY_CLASS "battery" 46 46 #define ACPI_SBS_DEVICE_NAME "Smart Battery System" 47 47 #define ACPI_SBS_FILE_INFO "info" 48 48 #define ACPI_SBS_FILE_STATE "state"