/* returns 0 if write is successful, -1 else.  */
static int write_acpi_int(acpi_handle handle, const char *method, int val, struct acpi_buffer *output)
/* returns 0 if write is successful, -1 else.  */
static int write_acpi_int(acpi_handle handle, const char *method, int val, struct acpi_buffer *output)
{
	struct acpi_object_list params;
	union acpi_object in_obj;
	acpi_status status;
	if (!handle)
		return 0;
	params.count = 1;
	params.pointer = &in_obj;
	in_obj.type = ACPI_TYPE_INTEGER;
	in_obj.integer.value = val;
	status = acpi_evaluate_object(handle, (char *)method, &params, output);
	if (status == AE_OK)
		return 0;
	else
		return -1;
}