diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-03-31 21:25:40 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-04-04 20:37:02 +0200 |
| commit | 9bcdd4ef4cd24ff360c6d0df3b8efad35d82bd94 (patch) | |
| tree | 67594633ada37fad999910cb0a44f5f8b2d04c41 | |
| parent | b14b77bbea0a82cb66f1538824783e63d4128510 (diff) | |
| download | linux-9bcdd4ef4cd24ff360c6d0df3b8efad35d82bd94.tar.gz linux-9bcdd4ef4cd24ff360c6d0df3b8efad35d82bd94.zip | |
ACPI: TAD: Relocate two functions
Move two functions introduced previously, __acpi_tad_wake_set() and
__acpi_tad_wake_read(), to the part of the code preceding the sysfs
interface implementation, since subsequently they will be used by
the RTC device interface too.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/3960639.kQq0lBPeGt@rafael.j.wysocki
| -rw-r--r-- | drivers/acpi/acpi_tad.c | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c index 7b422904e45b..a0857a7904df 100644 --- a/drivers/acpi/acpi_tad.c +++ b/drivers/acpi/acpi_tad.c @@ -174,6 +174,53 @@ static int acpi_tad_get_real_time(struct device *dev, struct acpi_tad_rt *rt) return __acpi_tad_get_real_time(dev, rt); } +static int __acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id, + u32 value) +{ + acpi_handle handle = ACPI_HANDLE(dev); + union acpi_object args[] = { + { .type = ACPI_TYPE_INTEGER, }, + { .type = ACPI_TYPE_INTEGER, }, + }; + struct acpi_object_list arg_list = { + .pointer = args, + .count = ARRAY_SIZE(args), + }; + unsigned long long retval; + acpi_status status; + + args[0].integer.value = timer_id; + args[1].integer.value = value; + + status = acpi_evaluate_integer(handle, method, &arg_list, &retval); + if (ACPI_FAILURE(status) || retval) + return -EIO; + + return 0; +} + +static int __acpi_tad_wake_read(struct device *dev, char *method, u32 timer_id, + unsigned long long *retval) +{ + acpi_handle handle = ACPI_HANDLE(dev); + union acpi_object args[] = { + { .type = ACPI_TYPE_INTEGER, }, + }; + struct acpi_object_list arg_list = { + .pointer = args, + .count = ARRAY_SIZE(args), + }; + acpi_status status; + + args[0].integer.value = timer_id; + + status = acpi_evaluate_integer(handle, method, &arg_list, retval); + if (ACPI_FAILURE(status)) + return -EIO; + + return 0; +} + /* sysfs interface */ static char *acpi_tad_rt_next_field(char *s, int *val) @@ -273,31 +320,6 @@ static ssize_t time_show(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR_RW(time); -static int __acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id, - u32 value) -{ - acpi_handle handle = ACPI_HANDLE(dev); - union acpi_object args[] = { - { .type = ACPI_TYPE_INTEGER, }, - { .type = ACPI_TYPE_INTEGER, }, - }; - struct acpi_object_list arg_list = { - .pointer = args, - .count = ARRAY_SIZE(args), - }; - unsigned long long retval; - acpi_status status; - - args[0].integer.value = timer_id; - args[1].integer.value = value; - - status = acpi_evaluate_integer(handle, method, &arg_list, &retval); - if (ACPI_FAILURE(status) || retval) - return -EIO; - - return 0; -} - static int acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id, u32 value) { @@ -328,28 +350,6 @@ static int acpi_tad_wake_write(struct device *dev, const char *buf, char *method return acpi_tad_wake_set(dev, method, timer_id, value); } -static int __acpi_tad_wake_read(struct device *dev, char *method, u32 timer_id, - unsigned long long *retval) -{ - acpi_handle handle = ACPI_HANDLE(dev); - union acpi_object args[] = { - { .type = ACPI_TYPE_INTEGER, }, - }; - struct acpi_object_list arg_list = { - .pointer = args, - .count = ARRAY_SIZE(args), - }; - acpi_status status; - - args[0].integer.value = timer_id; - - status = acpi_evaluate_integer(handle, method, &arg_list, retval); - if (ACPI_FAILURE(status)) - return -EIO; - - return 0; -} - static ssize_t acpi_tad_wake_read(struct device *dev, char *buf, char *method, u32 timer_id, const char *specval) { |
