[PATCH 2/2] acer-wmi: remove interface sysfs file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove interface sysfs file that exposed which ACPI-WMI interface
that was used by acer-wmi driver. It was replaced by information log
when acer-wmi initial.

Tested on Acer Travelmate 8572

Cc: Carlos Corbacho <carlos@xxxxxxxxxxxxxxxxxxx>
Cc: Matthew Garrett <mjg@xxxxxxxxxx>
Cc: Dmitry Torokhov <dtor@xxxxxxx>
Cc: Corentin Chary <corentincj@xxxxxxxxxx>
Cc: Thomas Renninger <trenn@xxxxxxx>
Signed-off-by: Lee, Chun-Yi <jlee@xxxxxxxxxx>
---
 drivers/platform/x86/acer-wmi.c |   59 ++++----------------------------------
 1 files changed, 7 insertions(+), 52 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index ba10dba..64b7e20 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1388,26 +1388,6 @@ static void acer_rfkill_exit(void)
 	return;
 }
 
-/*
- * sysfs interface
- */
-static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
-	char *buf)
-{
-	switch (interface->type) {
-	case ACER_AMW0:
-		return sprintf(buf, "AMW0\n");
-	case ACER_AMW0_V2:
-		return sprintf(buf, "AMW0 v2\n");
-	case ACER_WMID:
-		return sprintf(buf, "WMID\n");
-	default:
-		return sprintf(buf, "Error!\n");
-	}
-}
-
-static DEVICE_ATTR(interface, S_IRUGO, show_interface, NULL);
-
 static void acer_wmi_notify(u32 value, void *context)
 {
 	struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -1725,29 +1705,6 @@ static struct platform_driver acer_platform_driver = {
 
 static struct platform_device *acer_platform_device;
 
-static int remove_sysfs(struct platform_device *device)
-{
-	device_remove_file(&device->dev, &dev_attr_interface);
-
-	return 0;
-}
-
-static int create_sysfs(void)
-{
-	int retval = -ENOMEM;
-
-	retval = device_create_file(&acer_platform_device->dev,
-		&dev_attr_interface);
-	if (retval)
-		goto error_sysfs;
-
-	return 0;
-
-error_sysfs:
-		remove_sysfs(acer_platform_device);
-	return retval;
-}
-
 static void remove_debugfs(void)
 {
 	debugfs_remove(interface->debug.devices);
@@ -1791,11 +1748,15 @@ static int __init acer_wmi_init(void)
 	/*
 	 * Detect which ACPI-WMI interface we're using.
 	 */
-	if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))
+	if (wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1)) {
+		pr_info("Using AMW0 v2 interface\n");
 		interface = &AMW0_V2_interface;
+	}
 
-	if (!wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1))
+	if (!wmi_has_guid(AMW0_GUID1) && wmi_has_guid(WMID_GUID1)) {
+		pr_info("Using WMID interface\n");
 		interface = &wmid_interface;
+	}
 
 	if (wmi_has_guid(WMID_GUID2) && interface) {
 		if (ACPI_FAILURE(WMID_set_capabilities())) {
@@ -1808,6 +1769,7 @@ static int __init acer_wmi_init(void)
 	}
 
 	if (wmi_has_guid(AMW0_GUID1) && !wmi_has_guid(WMID_GUID1)) {
+		pr_info("Using AMW0 interface\n");
 		interface = &AMW0_interface;
 
 		if (ACPI_FAILURE(AMW0_set_capabilities())) {
@@ -1868,10 +1830,6 @@ static int __init acer_wmi_init(void)
 	if (err)
 		goto error_device_add;
 
-	err = create_sysfs();
-	if (err)
-		goto error_create_sys;
-
 	if (wmi_has_guid(WMID_GUID2)) {
 		interface->debug.wmid_devices = get_wmid_devices();
 		err = create_debugfs();
@@ -1885,8 +1843,6 @@ static int __init acer_wmi_init(void)
 	return 0;
 
 error_create_debugfs:
-	remove_sysfs(acer_platform_device);
-error_create_sys:
 	platform_device_del(acer_platform_device);
 error_device_add:
 	platform_device_put(acer_platform_device);
@@ -1904,7 +1860,6 @@ static void __exit acer_wmi_exit(void)
 	if (wmi_has_guid(ACERWMID_EVENT_GUID))
 		acer_wmi_input_destroy();
 
-	remove_sysfs(acer_platform_device);
 	remove_debugfs();
 	platform_device_unregister(acer_platform_device);
 	platform_driver_unregister(&acer_platform_driver);
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux