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


Groups > linux.kernel > #1595998 > unrolled thread

[PATCH 09/14] platform/x86: msi-laptop: remove sparse_keymap_free() calls

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-03-09 13:20 +0100
Last post2017-03-09 13:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/14] platform/x86: msi-laptop: remove sparse_keymap_free() calls Michał Kępień <kernel@kempniu.pl> - 2017-03-09 13:20 +0100

#1595998 — [PATCH 09/14] platform/x86: msi-laptop: remove sparse_keymap_free() calls

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-09 13:20 +0100
Subject[PATCH 09/14] platform/x86: msi-laptop: remove sparse_keymap_free() calls
Message-ID<tj5cZ-523-7@gated-at.bofh.it>
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().

As this reduces msi_laptop_input_destroy() to one line, replace all
calls to that function with direct calls to input_unregister_device().

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

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 42317704629d..9e90827c176a 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -976,23 +976,15 @@ static int __init msi_laptop_input_setup(void)
 
 	err = input_register_device(msi_laptop_input_dev);
 	if (err)
-		goto err_free_keymap;
+		goto err_free_dev;
 
 	return 0;
 
-err_free_keymap:
-	sparse_keymap_free(msi_laptop_input_dev);
 err_free_dev:
 	input_free_device(msi_laptop_input_dev);
 	return err;
 }
 
-static void msi_laptop_input_destroy(void)
-{
-	sparse_keymap_free(msi_laptop_input_dev);
-	input_unregister_device(msi_laptop_input_dev);
-}
-
 static int __init load_scm_model_init(struct platform_device *sdev)
 {
 	u8 data;
@@ -1037,7 +1029,7 @@ static int __init load_scm_model_init(struct platform_device *sdev)
 	return 0;
 
 fail_filter:
-	msi_laptop_input_destroy();
+	input_unregister_device(msi_laptop_input_dev);
 
 fail_input:
 	rfkill_cleanup();
@@ -1158,7 +1150,7 @@ static void __exit msi_cleanup(void)
 {
 	if (quirks->load_scm_model) {
 		i8042_remove_filter(msi_laptop_i8042_filter);
-		msi_laptop_input_destroy();
+		input_unregister_device(msi_laptop_input_dev);
 		cancel_delayed_work_sync(&msi_rfkill_dwork);
 		cancel_work_sync(&msi_rfkill_work);
 		rfkill_cleanup();
-- 
2.12.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web