platform/x86: ideapad-laptop: remove sparse_keymap_free() calls
authorMichał Kępień <kernel@kempniu.pl>
Thu, 9 Mar 2017 12:11:44 +0000 (13:11 +0100)
committerDarren Hart <dvhart@infradead.org>
Wed, 15 Mar 2017 05:58:07 +0000 (22:58 -0700)
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>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/ideapad-laptop.c

index cc6d91e186837e60bc5ab393cc652da1e27f05f9..ca5eeb4d417d0a9246a3c912dbc560a917facd98 100644 (file)
@@ -604,14 +604,12 @@ static int ideapad_input_init(struct ideapad_private *priv)
        error = input_register_device(inputdev);
        if (error) {
                pr_err("Unable to register input device\n");
-               goto err_free_keymap;
+               goto err_free_dev;
        }
 
        priv->inputdev = inputdev;
        return 0;
 
-err_free_keymap:
-       sparse_keymap_free(inputdev);
 err_free_dev:
        input_free_device(inputdev);
        return error;
@@ -619,7 +617,6 @@ err_free_dev:
 
 static void ideapad_input_exit(struct ideapad_private *priv)
 {
-       sparse_keymap_free(priv->inputdev);
        input_unregister_device(priv->inputdev);
        priv->inputdev = NULL;
 }