]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: TAD: Relocate two functions
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 31 Mar 2026 19:25:40 +0000 (21:25 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 4 Apr 2026 18:37:02 +0000 (20:37 +0200)
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
drivers/acpi/acpi_tad.c

index 7b422904e45b4f35eba50b35f4e00f42a6c2a1b1..a0857a7904df0d3cc9fe76704f0fd69ac6246e0c 100644 (file)
@@ -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)
 {