Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596015

[PATCH 10/14] platform/x86: msi-wmi: remove sparse_keymap_free() calls

From Michał Kępień <kernel@kempniu.pl>
Newsgroups linux.kernel
Subject [PATCH 10/14] platform/x86: msi-wmi: remove sparse_keymap_free() calls
Date 2017-03-09 13:20 +0100
Message-ID <tj5d1-523-47@gated-at.bofh.it> (permalink)
References <tj5cZ-523-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


As sparse_keymap_setup() now uses a managed memory allocation for the
keymap copy it creates, the latter is freed automatically.  Remove all
calls to sparse_keymap_free().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/platform/x86/msi-wmi.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index 9a32f8627ecc..f6209b739ec0 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -281,14 +281,12 @@ static int __init msi_wmi_input_setup(void)
 	err = input_register_device(msi_wmi_input_dev);
 
 	if (err)
-		goto err_free_keymap;
+		goto err_free_dev;
 
 	last_pressed = 0;
 
 	return 0;
 
-err_free_keymap:
-	sparse_keymap_free(msi_wmi_input_dev);
 err_free_dev:
 	input_free_device(msi_wmi_input_dev);
 	return err;
@@ -342,10 +340,8 @@ static int __init msi_wmi_init(void)
 	if (event_wmi)
 		wmi_remove_notify_handler(event_wmi->guid);
 err_free_input:
-	if (event_wmi) {
-		sparse_keymap_free(msi_wmi_input_dev);
+	if (event_wmi)
 		input_unregister_device(msi_wmi_input_dev);
-	}
 	return err;
 }
 
@@ -353,7 +349,6 @@ static void __exit msi_wmi_exit(void)
 {
 	if (event_wmi) {
 		wmi_remove_notify_handler(event_wmi->guid);
-		sparse_keymap_free(msi_wmi_input_dev);
 		input_unregister_device(msi_wmi_input_dev);
 	}
 	backlight_device_unregister(backlight);
-- 
2.12.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/14] platform/x86: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100
  [PATCH 07/14] platform/x86: hp-wmi: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100
  [PATCH 06/14] platform/x86: eeepc-laptop: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100
  [PATCH 04/14] platform/x86: dell-wmi-aio: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100
  [PATCH 10/14] platform/x86: msi-wmi: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100
  [PATCH 14/14] platform/x86: toshiba_acpi: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:30 +0100
  Re: [PATCH 00/14] platform/x86: remove sparse_keymap_free() calls Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-13 17:20 +0100

csiph-web