Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3770481ybl; Mon, 3 Feb 2020 06:15:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzvrIfEsIyZJgMZ0dpoQ0TbdooPz4oDM6mQ6ATkiHiK6C50UmMHLEXZ3RNCECdU6ZLGfojF X-Received: by 2002:a05:6830:1e47:: with SMTP id e7mr18551215otj.78.1580739331500; Mon, 03 Feb 2020 06:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580739331; cv=none; d=google.com; s=arc-20160816; b=XnbR7cH2THCsXm0Ts+y0MqTdzjYKkWLlbB7TXxOkG1GZGmJy5Rffi0s/WhLaxy+YeA VYg+hNnYEZqdqRgDzjZTFP/lucuKb8OrFApI6Ahza0hUPEhxZIvd1wB3Cqf+rUX1DZI6 rrdp8qJbt/JHwpo9Gt/ol563kyk46SzSVXcVouhrPUXrjNytuCCIHWeWQXUB+8imLMnP 5On2Nj4UwwpTXG0VdREfAdz/RyRq/agpmooLBvCmBP99a6t/jbHudM6xCeO/B7/3a9LL kFeXSg8OK5hoiKUlpb2gkUBz7HraKsdxNfqdKjgde2YAnB7niw9CqEHM14VutJa0dsRi kWHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=LCL9z5ep2OLo0hAQHUxZghMNPkPdHVWggQlDt2thL/s=; b=hdMlcrxqZGy/77dnqKEM5Gzy/7VjzqYywQL7xLD9dG4iyw7QRuHvhfqXvip28AWzs5 LS/g/+0EcxM4u28F+f03fmbpb9P26g02S85qdMJIBaX6WWo1pMqZbO5KuW7SwRDhQqkq tEHbtDbrfOcxtiIG/NIrsaovYw6oUA2PlRkg90jBt9QA0AD0wUtVQOZ3fSaOQEr/Oj1/ CGM6FA23Cf7lzrY8a2rtiCf/Dp3bNxW48P+ClFZkpwhUZlPyMZgRWUAF2zGHrES8GkaW 31tKROe277qSqKp5wIANmbZGEwLNSaEO88bRIF/0c14O4xhuqp/O6WnLJEeAx/5vztT8 +6iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=lCd6EmFR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si10553483otg.66.2020.02.03.06.15.05; Mon, 03 Feb 2020 06:15:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=lCd6EmFR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727632AbgBCMCF (ORCPT + 99 others); Mon, 3 Feb 2020 07:02:05 -0500 Received: from ned.t-8ch.de ([212.47.237.191]:51366 "EHLO ned.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727605AbgBCMCE (ORCPT ); Mon, 3 Feb 2020 07:02:04 -0500 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1580731319; bh=+Okifast5Z8vy48S+GU5utB9xtgNB2T6HyQybZGy9QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lCd6EmFRjcfVSf9KPW/Pb5jEK245CM+n2FWTxeU5ErT4p1PFul8W0Qki4uz4CGzUw 04popHu62sT/mL3K2AQDbaW+tgnUDkekbocncbVhWy4LWbOCSPBY9mGm/FXBEHUuY7 u7R1RBxFo2LbBBkzOIa5D4347raGJQ4R6p9CmLVs= To: Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko Cc: ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Subject: [PATCH v3 2/2] platform/x86: thinkpad_acpi: use standard charge control attribute names Date: Mon, 3 Feb 2020 13:01:32 +0100 Message-Id: <20200203120132.102576-3-linux@weissschuh.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203120132.102576-2-linux@weissschuh.net> References: <20200131143650.4149-1-linux@weissschuh.net> <20200203120132.102576-1-linux@weissschuh.net> <20200203120132.102576-2-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/platform/x86/thinkpad_acpi.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 2d3a99e3efb7..2cbcd2e3092f 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9608,38 +9608,52 @@ static ssize_t tpacpi_battery_show(int what, return sprintf(buf, "%d\n", ret); } -static ssize_t charge_start_threshold_show(struct device *device, +static ssize_t charge_control_start_threshold_show(struct device *device, struct device_attribute *attr, char *buf) { return tpacpi_battery_show(THRESHOLD_START, device, buf); } -static ssize_t charge_stop_threshold_show(struct device *device, +static ssize_t charge_control_end_threshold_show(struct device *device, struct device_attribute *attr, char *buf) { return tpacpi_battery_show(THRESHOLD_STOP, device, buf); } -static ssize_t charge_start_threshold_store(struct device *dev, +static ssize_t charge_control_start_threshold_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { return tpacpi_battery_store(THRESHOLD_START, dev, buf, count); } -static ssize_t charge_stop_threshold_store(struct device *dev, +static ssize_t charge_control_end_threshold_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { return tpacpi_battery_store(THRESHOLD_STOP, dev, buf, count); } -static DEVICE_ATTR_RW(charge_start_threshold); -static DEVICE_ATTR_RW(charge_stop_threshold); +static DEVICE_ATTR_RW(charge_control_start_threshold); +static DEVICE_ATTR_RW(charge_control_end_threshold); +struct device_attribute dev_attr_charge_start_threshold = __ATTR( + charge_start_threshold, + 0644, + charge_control_start_threshold_show, + charge_control_start_threshold_store +); +struct device_attribute dev_attr_charge_stop_threshold = __ATTR( + charge_stop_threshold, + 0644, + charge_control_end_threshold_show, + charge_control_end_threshold_store +); static struct attribute *tpacpi_battery_attrs[] = { + &dev_attr_charge_control_start_threshold.attr, + &dev_attr_charge_control_end_threshold.attr, &dev_attr_charge_start_threshold.attr, &dev_attr_charge_stop_threshold.attr, NULL, -- 2.25.0