aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2015-10-05 06:17:42 -0400
committerDarren Hart <dvhart@linux.intel.com>2015-10-06 18:38:08 -0400
commitc4602280869e7aceb1245f525eff923e548ec9f3 (patch)
treeaca2fea94fbb9e043168cb79f47d913d034cc886
parent7d3777d1069137800cdd1420a6c75cd94151d877 (diff)
acer-wmi: remove threeg and interface sysfs interfaces
Since v3.0 kernel, acer-wmi driver auto detects internal 3G device and provides the threeg rfkill interface. So the sysfs interface of 3G is no longer necessary now. The 7b8aca65 patch added kernel information log to remind to user space for the threeg sysfs interface will be removed in 2012, then b58b9ffc patch updated the interface removing time to 2014. I think the 3 years lead time is enough for user space application to use rfkill instead of sysfs interface to control 3G device. This patch removes code about threeg sysfs interface. And it also removes the unused interface sysfs that exposes which ACPI-WMI method used by acer-wmi driver on the machine. The information is already exposed by the acer-wmi initial log. Cc: Carlos Corbacho <carlos@strangeworlds.co.uk> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Martin Kepplinger <martink@posteo.de> Cc: Darren Hart <dvhart@infradead.org> Signed-off-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r--drivers/platform/x86/acer-wmi.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index d773b9dc48a0..1062fa42ff26 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1662,58 +1662,6 @@ static void acer_rfkill_exit(void)
1662 return; 1662 return;
1663} 1663}
1664 1664
1665/*
1666 * sysfs interface
1667 */
1668static ssize_t show_bool_threeg(struct device *dev,
1669 struct device_attribute *attr, char *buf)
1670{
1671 u32 result; \
1672 acpi_status status;
1673
1674 pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
1675 current->comm);
1676 status = get_u32(&result, ACER_CAP_THREEG);
1677 if (ACPI_SUCCESS(status))
1678 return sprintf(buf, "%u\n", result);
1679 return sprintf(buf, "Read error\n");
1680}
1681
1682static ssize_t set_bool_threeg(struct device *dev,
1683 struct device_attribute *attr, const char *buf, size_t count)
1684{
1685 u32 tmp = simple_strtoul(buf, NULL, 10);
1686 acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
1687 pr_info("This threeg sysfs will be removed in 2014 - used by: %s\n",
1688 current->comm);
1689 if (ACPI_FAILURE(status))
1690 return -EINVAL;
1691 return count;
1692}
1693static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
1694 set_bool_threeg);
1695
1696static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
1697 char *buf)
1698{
1699 pr_info("This interface sysfs will be removed in 2014 - used by: %s\n",
1700 current->comm);
1701 switch (interface->type) {
1702 case ACER_AMW0:
1703 return sprintf(buf, "AMW0\n");
1704 case ACER_AMW0_V2:
1705 return sprintf(buf, "AMW0 v2\n");
1706 case ACER_WMID:
1707 return sprintf(buf, "WMID\n");
1708 case ACER_WMID_v2:
1709 return sprintf(buf, "WMID v2\n");
1710 default:
1711 return sprintf(buf, "Error!\n");
1712 }
1713}
1714
1715static DEVICE_ATTR(interface, S_IRUGO, show_interface, NULL);
1716
1717static void acer_wmi_notify(u32 value, void *context) 1665static void acer_wmi_notify(u32 value, void *context)
1718{ 1666{
1719 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 1667 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -2127,39 +2075,6 @@ static struct platform_driver acer_platform_driver = {
2127 2075
2128static struct platform_device *acer_platform_device; 2076static struct platform_device *acer_platform_device;
2129 2077
2130static int remove_sysfs(struct platform_device *device)
2131{
2132 if (has_cap(ACER_CAP_THREEG))
2133 device_remove_file(&device->dev, &dev_attr_threeg);
2134
2135 device_remove_file(&device->dev, &dev_attr_interface);
2136
2137 return 0;
2138}
2139
2140static int __init create_sysfs(void)
2141{
2142 int retval = -ENOMEM;
2143
2144 if (has_cap(ACER_CAP_THREEG)) {
2145 retval = device_create_file(&acer_platform_device->dev,
2146 &dev_attr_threeg);
2147 if (retval)
2148 goto error_sysfs;
2149 }
2150
2151 retval = device_create_file(&acer_platform_device->dev,
2152 &dev_attr_interface);
2153 if (retval)
2154 goto error_sysfs;
2155
2156 return 0;
2157
2158error_sysfs:
2159 remove_sysfs(acer_platform_device);
2160 return retval;
2161}
2162
2163static void remove_debugfs(void) 2078static void remove_debugfs(void)
2164{ 2079{
2165 debugfs_remove(interface->debug.devices); 2080 debugfs_remove(interface->debug.devices);
@@ -2290,10 +2205,6 @@ static int __init acer_wmi_init(void)
2290 if (err) 2205 if (err)
2291 goto error_device_add; 2206 goto error_device_add;
2292 2207
2293 err = create_sysfs();
2294 if (err)
2295 goto error_create_sys;
2296
2297 if (wmi_has_guid(WMID_GUID2)) { 2208 if (wmi_has_guid(WMID_GUID2)) {
2298 interface->debug.wmid_devices = get_wmid_devices(); 2209 interface->debug.wmid_devices = get_wmid_devices();
2299 err = create_debugfs(); 2210 err = create_debugfs();
@@ -2307,8 +2218,6 @@ static int __init acer_wmi_init(void)
2307 return 0; 2218 return 0;
2308 2219
2309error_create_debugfs: 2220error_create_debugfs:
2310 remove_sysfs(acer_platform_device);
2311error_create_sys:
2312 platform_device_del(acer_platform_device); 2221 platform_device_del(acer_platform_device);
2313error_device_add: 2222error_device_add:
2314 platform_device_put(acer_platform_device); 2223 platform_device_put(acer_platform_device);
@@ -2331,7 +2240,6 @@ static void __exit acer_wmi_exit(void)
2331 if (has_cap(ACER_CAP_ACCEL)) 2240 if (has_cap(ACER_CAP_ACCEL))
2332 acer_wmi_accel_destroy(); 2241 acer_wmi_accel_destroy();
2333 2242
2334 remove_sysfs(acer_platform_device);
2335 remove_debugfs(); 2243 remove_debugfs();
2336 platform_device_unregister(acer_platform_device); 2244 platform_device_unregister(acer_platform_device);
2337 platform_driver_unregister(&acer_platform_driver); 2245 platform_driver_unregister(&acer_platform_driver);