Skip to contentSkip to conversation

intel-hid: remove duplicated acpi_remove_notify_handler and extra indents

PATCH In review Alex Hung 2 participants 2 messages Jun 29, 2016 x86 platform drivers

lore
Share & tools
lore

Alex Hung

author
#0 lore raw

PATCH v2 1/1 intel-hid: remove duplicated acpi_remove_notify_handler and extra indents

Two lines are indented incorrectly and is fixed. The second call to acpi_remove_notify_handler does not result in panic or generate error messages, but it is unnecessary and the function returns with an error.

---
 drivers/platform/x86/intel-hid.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/platform/x86/intel-hid.c +2 -3
index a818db6..ed58742 100644
@@ -122,8 +122,8 @@ static int intel_hid_input_setup(struct platform_device *device)
 	return 0;
 
 err_free_device:
-		input_free_device(priv->input_dev);
-		return ret;
+	input_free_device(priv->input_dev);
+	return ret;
 }
 
 static void intel_hid_input_destroy(struct platform_device *device)
@@ -224,7 +224,6 @@ static int intel_hid_remove(struct platform_device *device)
 	acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
 	intel_hid_input_destroy(device);
 	intel_hid_set_enable(&device->dev, 0);
-	acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
 
 	/*
 	 * Even if we failed to shut off the event stream, we can still
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Alex Hung

Two lines are indented incorrectly and is fixed. The second call to acpi_remove_notify_handler does not result in panic or generate error messages, but it is unnecessary and the function returns with an error.

Thank you Alex, queued to testing for 4.8.

Quoted 31 lines
---
 drivers/platform/x86/intel-hid.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/platform/x86/intel-hid.c +2 -3
index a818db6..ed58742 100644
@@ -122,8 +122,8 @@ static int intel_hid_input_setup(struct platform_device *device)
 	return 0;
 
 err_free_device:
-		input_free_device(priv->input_dev);
-		return ret;
+	input_free_device(priv->input_dev);
+	return ret;
 }
 
 static void intel_hid_input_destroy(struct platform_device *device)
@@ -224,7 +224,6 @@ static int intel_hid_remove(struct platform_device *device)
 	acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
 	intel_hid_input_destroy(device);
 	intel_hid_set_enable(&device->dev, 0);
-	acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
 
 	/*
 	 * Even if we failed to shut off the event stream, we can still
Signature · 1 line
2.7.4
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center