Commit b09b9195 authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart

platform/x86: panasonic-laptop: remove sparse_keymap_free() calls

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 acpi_pcc_destroy_input() to one line, replace all calls
to that function with direct calls to input_unregister_device().
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 0788e337
...@@ -520,29 +520,17 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) ...@@ -520,29 +520,17 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)
if (error) { if (error) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to register input device\n")); "Unable to register input device\n"));
goto err_free_keymap; goto err_free_dev;
} }
pcc->input_dev = input_dev; pcc->input_dev = input_dev;
return 0; return 0;
err_free_keymap:
sparse_keymap_free(input_dev);
err_free_dev: err_free_dev:
input_free_device(input_dev); input_free_device(input_dev);
return error; return error;
} }
static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)
{
sparse_keymap_free(pcc->input_dev);
input_unregister_device(pcc->input_dev);
/*
* No need to input_free_device() since core input API refcounts
* and free()s the device.
*/
}
/* kernel module interface */ /* kernel module interface */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
...@@ -640,7 +628,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) ...@@ -640,7 +628,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
out_backlight: out_backlight:
backlight_device_unregister(pcc->backlight); backlight_device_unregister(pcc->backlight);
out_input: out_input:
acpi_pcc_destroy_input(pcc); input_unregister_device(pcc->input_dev);
out_sinf: out_sinf:
kfree(pcc->sinf); kfree(pcc->sinf);
out_hotkey: out_hotkey:
...@@ -660,7 +648,7 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device) ...@@ -660,7 +648,7 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device)
backlight_device_unregister(pcc->backlight); backlight_device_unregister(pcc->backlight);
acpi_pcc_destroy_input(pcc); input_unregister_device(pcc->input_dev);
kfree(pcc->sinf); kfree(pcc->sinf);
kfree(pcc); kfree(pcc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment