Skip to content

Commit 9bcdd4e

Browse files
committed
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
1 parent b14b77b commit 9bcdd4e

1 file changed

Lines changed: 47 additions & 47 deletions

File tree

drivers/acpi/acpi_tad.c

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,53 @@ static int acpi_tad_get_real_time(struct device *dev, struct acpi_tad_rt *rt)
174174
return __acpi_tad_get_real_time(dev, rt);
175175
}
176176

177+
static int __acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id,
178+
u32 value)
179+
{
180+
acpi_handle handle = ACPI_HANDLE(dev);
181+
union acpi_object args[] = {
182+
{ .type = ACPI_TYPE_INTEGER, },
183+
{ .type = ACPI_TYPE_INTEGER, },
184+
};
185+
struct acpi_object_list arg_list = {
186+
.pointer = args,
187+
.count = ARRAY_SIZE(args),
188+
};
189+
unsigned long long retval;
190+
acpi_status status;
191+
192+
args[0].integer.value = timer_id;
193+
args[1].integer.value = value;
194+
195+
status = acpi_evaluate_integer(handle, method, &arg_list, &retval);
196+
if (ACPI_FAILURE(status) || retval)
197+
return -EIO;
198+
199+
return 0;
200+
}
201+
202+
static int __acpi_tad_wake_read(struct device *dev, char *method, u32 timer_id,
203+
unsigned long long *retval)
204+
{
205+
acpi_handle handle = ACPI_HANDLE(dev);
206+
union acpi_object args[] = {
207+
{ .type = ACPI_TYPE_INTEGER, },
208+
};
209+
struct acpi_object_list arg_list = {
210+
.pointer = args,
211+
.count = ARRAY_SIZE(args),
212+
};
213+
acpi_status status;
214+
215+
args[0].integer.value = timer_id;
216+
217+
status = acpi_evaluate_integer(handle, method, &arg_list, retval);
218+
if (ACPI_FAILURE(status))
219+
return -EIO;
220+
221+
return 0;
222+
}
223+
177224
/* sysfs interface */
178225

179226
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,
273320

274321
static DEVICE_ATTR_RW(time);
275322

276-
static int __acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id,
277-
u32 value)
278-
{
279-
acpi_handle handle = ACPI_HANDLE(dev);
280-
union acpi_object args[] = {
281-
{ .type = ACPI_TYPE_INTEGER, },
282-
{ .type = ACPI_TYPE_INTEGER, },
283-
};
284-
struct acpi_object_list arg_list = {
285-
.pointer = args,
286-
.count = ARRAY_SIZE(args),
287-
};
288-
unsigned long long retval;
289-
acpi_status status;
290-
291-
args[0].integer.value = timer_id;
292-
args[1].integer.value = value;
293-
294-
status = acpi_evaluate_integer(handle, method, &arg_list, &retval);
295-
if (ACPI_FAILURE(status) || retval)
296-
return -EIO;
297-
298-
return 0;
299-
}
300-
301323
static int acpi_tad_wake_set(struct device *dev, char *method, u32 timer_id,
302324
u32 value)
303325
{
@@ -328,28 +350,6 @@ static int acpi_tad_wake_write(struct device *dev, const char *buf, char *method
328350
return acpi_tad_wake_set(dev, method, timer_id, value);
329351
}
330352

331-
static int __acpi_tad_wake_read(struct device *dev, char *method, u32 timer_id,
332-
unsigned long long *retval)
333-
{
334-
acpi_handle handle = ACPI_HANDLE(dev);
335-
union acpi_object args[] = {
336-
{ .type = ACPI_TYPE_INTEGER, },
337-
};
338-
struct acpi_object_list arg_list = {
339-
.pointer = args,
340-
.count = ARRAY_SIZE(args),
341-
};
342-
acpi_status status;
343-
344-
args[0].integer.value = timer_id;
345-
346-
status = acpi_evaluate_integer(handle, method, &arg_list, retval);
347-
if (ACPI_FAILURE(status))
348-
return -EIO;
349-
350-
return 0;
351-
}
352-
353353
static ssize_t acpi_tad_wake_read(struct device *dev, char *buf, char *method,
354354
u32 timer_id, const char *specval)
355355
{

0 commit comments

Comments
 (0)