You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'misc' into release
This commit is contained in:
@@ -184,6 +184,7 @@ static const struct acpi_device_id pcc_device_ids[] = {
|
||||
{ "MAT0019", 0},
|
||||
{ "", 0},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
|
||||
|
||||
static struct acpi_driver acpi_pcc_driver = {
|
||||
.name = ACPI_PCC_DRIVER_NAME,
|
||||
@@ -366,7 +367,7 @@ static ssize_t show_numbatt(struct device *dev, struct device_attribute *attr,
|
||||
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
|
||||
return -EIO;
|
||||
|
||||
return sprintf(buf, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
|
||||
}
|
||||
|
||||
static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
|
||||
@@ -378,7 +379,7 @@ static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
|
||||
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
|
||||
return -EIO;
|
||||
|
||||
return sprintf(buf, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
|
||||
}
|
||||
|
||||
static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
|
||||
@@ -390,7 +391,7 @@ static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
|
||||
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
|
||||
return -EIO;
|
||||
|
||||
return sprintf(buf, "%u\n", pcc->sinf[SINF_MUTE]);
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
|
||||
}
|
||||
|
||||
static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
|
||||
@@ -402,7 +403,7 @@ static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
|
||||
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
|
||||
return -EIO;
|
||||
|
||||
return sprintf(buf, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
|
||||
}
|
||||
|
||||
static ssize_t set_sticky(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
@@ -94,9 +94,8 @@ static int get_state(u32 *out, u8 instance)
|
||||
return -ENODEV;
|
||||
|
||||
obj = (union acpi_object *) result.pointer;
|
||||
if (obj && obj->type == ACPI_TYPE_BUFFER &&
|
||||
obj->buffer.length == sizeof(u32)) {
|
||||
tmp = *((u32 *) obj->buffer.pointer);
|
||||
if (obj && obj->type == ACPI_TYPE_INTEGER) {
|
||||
tmp = obj->integer.value;
|
||||
} else {
|
||||
tmp = 0;
|
||||
}
|
||||
@@ -109,7 +108,7 @@ static int get_state(u32 *out, u8 instance)
|
||||
*out = (tmp == 3) ? 1 : 0;
|
||||
return 0;
|
||||
case TC1100_INSTANCE_JOGDIAL:
|
||||
*out = (tmp == 1) ? 1 : 0;
|
||||
*out = (tmp == 1) ? 0 : 1;
|
||||
return 0;
|
||||
default:
|
||||
return -ENODEV;
|
||||
|
||||
Reference in New Issue
Block a user