Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: thinkpad_acpi: use standard charge control attribute names

The standard attributes were only introduced after the ones from
thinkpad_acpi in commit 813cab8f3994 ("power: supply: core:
Add CHARGE_CONTROL_{START_THRESHOLD,END_THRESHOLD} properties").

The new standard attributes are aliased to their previous names,
preserving backwards compatibility.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

authored by

Thomas Weißschuh and committed by
Andy Shevchenko
e3392953 c1c04fbc

+20 -6
+20 -6
drivers/platform/x86/thinkpad_acpi.c
··· 9603 9603 return sprintf(buf, "%d\n", ret); 9604 9604 } 9605 9605 9606 - static ssize_t charge_start_threshold_show(struct device *device, 9606 + static ssize_t charge_control_start_threshold_show(struct device *device, 9607 9607 struct device_attribute *attr, 9608 9608 char *buf) 9609 9609 { 9610 9610 return tpacpi_battery_show(THRESHOLD_START, device, buf); 9611 9611 } 9612 9612 9613 - static ssize_t charge_stop_threshold_show(struct device *device, 9613 + static ssize_t charge_control_end_threshold_show(struct device *device, 9614 9614 struct device_attribute *attr, 9615 9615 char *buf) 9616 9616 { 9617 9617 return tpacpi_battery_show(THRESHOLD_STOP, device, buf); 9618 9618 } 9619 9619 9620 - static ssize_t charge_start_threshold_store(struct device *dev, 9620 + static ssize_t charge_control_start_threshold_store(struct device *dev, 9621 9621 struct device_attribute *attr, 9622 9622 const char *buf, size_t count) 9623 9623 { 9624 9624 return tpacpi_battery_store(THRESHOLD_START, dev, buf, count); 9625 9625 } 9626 9626 9627 - static ssize_t charge_stop_threshold_store(struct device *dev, 9627 + static ssize_t charge_control_end_threshold_store(struct device *dev, 9628 9628 struct device_attribute *attr, 9629 9629 const char *buf, size_t count) 9630 9630 { 9631 9631 return tpacpi_battery_store(THRESHOLD_STOP, dev, buf, count); 9632 9632 } 9633 9633 9634 - static DEVICE_ATTR_RW(charge_start_threshold); 9635 - static DEVICE_ATTR_RW(charge_stop_threshold); 9634 + static DEVICE_ATTR_RW(charge_control_start_threshold); 9635 + static DEVICE_ATTR_RW(charge_control_end_threshold); 9636 + struct device_attribute dev_attr_charge_start_threshold = __ATTR( 9637 + charge_start_threshold, 9638 + 0644, 9639 + charge_control_start_threshold_show, 9640 + charge_control_start_threshold_store 9641 + ); 9642 + struct device_attribute dev_attr_charge_stop_threshold = __ATTR( 9643 + charge_stop_threshold, 9644 + 0644, 9645 + charge_control_end_threshold_show, 9646 + charge_control_end_threshold_store 9647 + ); 9636 9648 9637 9649 static struct attribute *tpacpi_battery_attrs[] = { 9650 + &dev_attr_charge_control_start_threshold.attr, 9651 + &dev_attr_charge_control_end_threshold.attr, 9638 9652 &dev_attr_charge_start_threshold.attr, 9639 9653 &dev_attr_charge_stop_threshold.attr, 9640 9654 NULL,