static bool
device_has_dsm(struct device *dev)
{
	acpi_handle handle;
	struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};

	handle = DEVICE_ACPI_HANDLE(dev);

	if (!handle)
		return FALSE;

	if (dsm_get_label(handle, DEVICE_LABEL_DSM, &output, NULL,
			  ACPI_ATTR_NONE) > 0)
		return TRUE;

	return FALSE;
}
static ssize_t
acpilabel_show(struct device *dev, struct device_attribute *attr, char *buf)
{
	struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
	acpi_handle handle;
	int length;

	handle = DEVICE_ACPI_HANDLE(dev);

	if (!handle)
		return -1;

	length = dsm_get_label(handle, DEVICE_LABEL_DSM,
			       &output, buf, ACPI_ATTR_LABEL_SHOW);

	if (length < 1)
		return -1;

	return length;
}
Exemple #3
0
static ssize_t acpiindex_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{
	return dsm_get_label(dev, buf, ACPI_ATTR_INDEX_SHOW);
}