diff mbox

[1/2] intel-hid: Remove duplicated acpi_remove_notify_handler

Message ID 1497054876-2924-2-git-send-email-alex.hung@canonical.com
State New
Headers show

Commit Message

Alex Hung June 10, 2017, 12:34 a.m. UTC
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. Remove the duplicate call. Correct two improperly
indented lines.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
(cherry picked from commit 1d6de071cb0c321279373634d81eb8e176d887c4)
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 drivers/platform/x86/intel-hid.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Colin Ian King June 12, 2017, 7:41 a.m. UTC | #1
On 10/06/17 01:34, Alex Hung wrote:
> 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. Remove the duplicate call. Correct two improperly
> indented lines.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> (cherry picked from commit 1d6de071cb0c321279373634d81eb8e176d887c4)
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  drivers/platform/x86/intel-hid.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
> index a818db6..ed58742 100644
> --- a/drivers/platform/x86/intel-hid.c
> +++ b/drivers/platform/x86/intel-hid.c
> @@ -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
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox

Patch

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index a818db6..ed58742 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -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