Commit 6942eabc authored by Alan Jenkins's avatar Alan Jenkins Committed by Andy Shevchenko

platform/x86: fujitsu-laptop: replace "hotkey" with "laptop" in symbol names

Functions, structures, variables and constants whose names currently
contain the "hotkey" keyword are not only responsible for handling
hotkeys, but also other laptop-related features (rfkill, lid, dock,
LEDs).  Fix their naming by using a consistent "_laptop"/"_LAPTOP"
suffix/infix.  Update comments so that they reflect this change.
Signed-off-by: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
[kempniu: rebase patch, rewrite commit message]
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJonathan Woithe <jwoithe@just42.net>
parent 9fc5cf6e
...@@ -82,9 +82,9 @@ ...@@ -82,9 +82,9 @@
#define ACPI_FUJITSU_BL_HID "FUJ02B1" #define ACPI_FUJITSU_BL_HID "FUJ02B1"
#define ACPI_FUJITSU_BL_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver" #define ACPI_FUJITSU_BL_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver"
#define ACPI_FUJITSU_BL_DEVICE_NAME "Fujitsu FUJ02B1" #define ACPI_FUJITSU_BL_DEVICE_NAME "Fujitsu FUJ02B1"
#define ACPI_FUJITSU_HOTKEY_HID "FUJ02E3" #define ACPI_FUJITSU_LAPTOP_HID "FUJ02E3"
#define ACPI_FUJITSU_HOTKEY_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver" #define ACPI_FUJITSU_LAPTOP_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver"
#define ACPI_FUJITSU_HOTKEY_DEVICE_NAME "Fujitsu FUJ02E3" #define ACPI_FUJITSU_LAPTOP_DEVICE_NAME "Fujitsu FUJ02E3"
#define ACPI_FUJITSU_NOTIFY_CODE1 0x80 #define ACPI_FUJITSU_NOTIFY_CODE1 0x80
...@@ -154,8 +154,8 @@ static struct fujitsu_bl *fujitsu_bl; ...@@ -154,8 +154,8 @@ static struct fujitsu_bl *fujitsu_bl;
static int use_alt_lcd_levels = -1; static int use_alt_lcd_levels = -1;
static int disable_brightness_adjust = -1; static int disable_brightness_adjust = -1;
/* Device used to access other hotkeys on the laptop */ /* Device used to access hotkeys and other features on the laptop */
struct fujitsu_hotkey_t { struct fujitsu_laptop {
acpi_handle acpi_handle; acpi_handle acpi_handle;
struct acpi_device *dev; struct acpi_device *dev;
struct input_dev *input; struct input_dev *input;
...@@ -171,9 +171,9 @@ struct fujitsu_hotkey_t { ...@@ -171,9 +171,9 @@ struct fujitsu_hotkey_t {
int eco_led_registered; int eco_led_registered;
}; };
static struct fujitsu_hotkey_t *fujitsu_hotkey; static struct fujitsu_laptop *fujitsu_laptop;
static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event); static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event);
#if IS_ENABLED(CONFIG_LEDS_CLASS) #if IS_ENABLED(CONFIG_LEDS_CLASS)
static enum led_brightness logolamp_get(struct led_classdev *cdev); static enum led_brightness logolamp_get(struct led_classdev *cdev);
...@@ -239,7 +239,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) ...@@ -239,7 +239,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
unsigned long long value; unsigned long long value;
acpi_handle handle = NULL; acpi_handle handle = NULL;
status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle); status = acpi_get_handle(fujitsu_laptop->acpi_handle, "FUNC", &handle);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
vdbg_printk(FUJLAPTOP_DBG_ERROR, vdbg_printk(FUJLAPTOP_DBG_ERROR,
"FUNC interface is not present\n"); "FUNC interface is not present\n");
...@@ -567,9 +567,9 @@ static ssize_t ...@@ -567,9 +567,9 @@ static ssize_t
show_lid_state(struct device *dev, show_lid_state(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_hotkey->rfkill_supported & 0x100)) if (!(fujitsu_laptop->rfkill_supported & 0x100))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
if (fujitsu_hotkey->rfkill_state & 0x100) if (fujitsu_laptop->rfkill_state & 0x100)
return sprintf(buf, "open\n"); return sprintf(buf, "open\n");
else else
return sprintf(buf, "closed\n"); return sprintf(buf, "closed\n");
...@@ -579,9 +579,9 @@ static ssize_t ...@@ -579,9 +579,9 @@ static ssize_t
show_dock_state(struct device *dev, show_dock_state(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_hotkey->rfkill_supported & 0x200)) if (!(fujitsu_laptop->rfkill_supported & 0x200))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
if (fujitsu_hotkey->rfkill_state & 0x200) if (fujitsu_laptop->rfkill_state & 0x200)
return sprintf(buf, "docked\n"); return sprintf(buf, "docked\n");
else else
return sprintf(buf, "undocked\n"); return sprintf(buf, "undocked\n");
...@@ -591,9 +591,9 @@ static ssize_t ...@@ -591,9 +591,9 @@ static ssize_t
show_radios_state(struct device *dev, show_radios_state(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
if (!(fujitsu_hotkey->rfkill_supported & 0x20)) if (!(fujitsu_laptop->rfkill_supported & 0x20))
return sprintf(buf, "unknown\n"); return sprintf(buf, "unknown\n");
if (fujitsu_hotkey->rfkill_state & 0x20) if (fujitsu_laptop->rfkill_state & 0x20)
return sprintf(buf, "on\n"); return sprintf(buf, "on\n");
else else
return sprintf(buf, "killed\n"); return sprintf(buf, "killed\n");
...@@ -840,7 +840,7 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event) ...@@ -840,7 +840,7 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
/* ACPI device for hotkey handling */ /* ACPI device for hotkey handling */
static int acpi_fujitsu_hotkey_add(struct acpi_device *device) static int acpi_fujitsu_laptop_add(struct acpi_device *device)
{ {
int result = 0; int result = 0;
int state = 0; int state = 0;
...@@ -851,32 +851,32 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -851,32 +851,32 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if (!device) if (!device)
return -EINVAL; return -EINVAL;
fujitsu_hotkey->acpi_handle = device->handle; fujitsu_laptop->acpi_handle = device->handle;
sprintf(acpi_device_name(device), "%s", sprintf(acpi_device_name(device), "%s",
ACPI_FUJITSU_HOTKEY_DEVICE_NAME); ACPI_FUJITSU_LAPTOP_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
device->driver_data = fujitsu_hotkey; device->driver_data = fujitsu_laptop;
/* kfifo */ /* kfifo */
spin_lock_init(&fujitsu_hotkey->fifo_lock); spin_lock_init(&fujitsu_laptop->fifo_lock);
error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int), error = kfifo_alloc(&fujitsu_laptop->fifo, RINGBUFFERSIZE * sizeof(int),
GFP_KERNEL); GFP_KERNEL);
if (error) { if (error) {
pr_err("kfifo_alloc failed\n"); pr_err("kfifo_alloc failed\n");
goto err_stop; goto err_stop;
} }
fujitsu_hotkey->input = input = input_allocate_device(); fujitsu_laptop->input = input = input_allocate_device();
if (!input) { if (!input) {
error = -ENOMEM; error = -ENOMEM;
goto err_free_fifo; goto err_free_fifo;
} }
snprintf(fujitsu_hotkey->phys, sizeof(fujitsu_hotkey->phys), snprintf(fujitsu_laptop->phys, sizeof(fujitsu_laptop->phys),
"%s/video/input0", acpi_device_hid(device)); "%s/video/input0", acpi_device_hid(device));
input->name = acpi_device_name(device); input->name = acpi_device_name(device);
input->phys = fujitsu_hotkey->phys; input->phys = fujitsu_laptop->phys;
input->id.bustype = BUS_HOST; input->id.bustype = BUS_HOST;
input->id.product = 0x06; input->id.product = 0x06;
input->dev.parent = &device->dev; input->dev.parent = &device->dev;
...@@ -894,7 +894,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -894,7 +894,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if (error) if (error)
goto err_free_input_dev; goto err_free_input_dev;
error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state); error = acpi_bus_update_power(fujitsu_laptop->acpi_handle, &state);
if (error) { if (error) {
pr_err("Error reading power state\n"); pr_err("Error reading power state\n");
goto err_unregister_input_dev; goto err_unregister_input_dev;
...@@ -904,7 +904,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -904,7 +904,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
acpi_device_name(device), acpi_device_bid(device), acpi_device_name(device), acpi_device_bid(device),
!device->power.state ? "on" : "off"); !device->power.state ? "on" : "off");
fujitsu_hotkey->dev = device; fujitsu_laptop->dev = device;
if (acpi_has_method(device->handle, METHOD_NAME__INI)) { if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
...@@ -920,16 +920,16 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -920,16 +920,16 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
; /* No action, result is discarded */ ; /* No action, result is discarded */
vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i); vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i);
fujitsu_hotkey->rfkill_supported = fujitsu_laptop->rfkill_supported =
call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0); call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0);
/* Make sure our bitmask of supported functions is cleared if the /* Make sure our bitmask of supported functions is cleared if the
RFKILL function block is not implemented, like on the S7020. */ RFKILL function block is not implemented, like on the S7020. */
if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD) if (fujitsu_laptop->rfkill_supported == UNSUPPORTED_CMD)
fujitsu_hotkey->rfkill_supported = 0; fujitsu_laptop->rfkill_supported = 0;
if (fujitsu_hotkey->rfkill_supported) if (fujitsu_laptop->rfkill_supported)
fujitsu_hotkey->rfkill_state = fujitsu_laptop->rfkill_state =
call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
/* Suspect this is a keymap of the application panel, print it */ /* Suspect this is a keymap of the application panel, print it */
...@@ -940,7 +940,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -940,7 +940,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
result = led_classdev_register(&fujitsu_bl->pf_device->dev, result = led_classdev_register(&fujitsu_bl->pf_device->dev,
&logolamp_led); &logolamp_led);
if (result == 0) { if (result == 0) {
fujitsu_hotkey->logolamp_registered = 1; fujitsu_laptop->logolamp_registered = 1;
} else { } else {
pr_err("Could not register LED handler for logo lamp, error %i\n", pr_err("Could not register LED handler for logo lamp, error %i\n",
result); result);
...@@ -952,7 +952,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -952,7 +952,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
result = led_classdev_register(&fujitsu_bl->pf_device->dev, result = led_classdev_register(&fujitsu_bl->pf_device->dev,
&kblamps_led); &kblamps_led);
if (result == 0) { if (result == 0) {
fujitsu_hotkey->kblamps_registered = 1; fujitsu_laptop->kblamps_registered = 1;
} else { } else {
pr_err("Could not register LED handler for keyboard lamps, error %i\n", pr_err("Could not register LED handler for keyboard lamps, error %i\n",
result); result);
...@@ -969,7 +969,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -969,7 +969,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
result = led_classdev_register(&fujitsu_bl->pf_device->dev, result = led_classdev_register(&fujitsu_bl->pf_device->dev,
&radio_led); &radio_led);
if (result == 0) { if (result == 0) {
fujitsu_hotkey->radio_led_registered = 1; fujitsu_laptop->radio_led_registered = 1;
} else { } else {
pr_err("Could not register LED handler for radio LED, error %i\n", pr_err("Could not register LED handler for radio LED, error %i\n",
result); result);
...@@ -986,7 +986,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -986,7 +986,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
result = led_classdev_register(&fujitsu_bl->pf_device->dev, result = led_classdev_register(&fujitsu_bl->pf_device->dev,
&eco_led); &eco_led);
if (result == 0) { if (result == 0) {
fujitsu_hotkey->eco_led_registered = 1; fujitsu_laptop->eco_led_registered = 1;
} else { } else {
pr_err("Could not register LED handler for eco LED, error %i\n", pr_err("Could not register LED handler for eco LED, error %i\n",
result); result);
...@@ -1002,47 +1002,47 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) ...@@ -1002,47 +1002,47 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
err_free_input_dev: err_free_input_dev:
input_free_device(input); input_free_device(input);
err_free_fifo: err_free_fifo:
kfifo_free(&fujitsu_hotkey->fifo); kfifo_free(&fujitsu_laptop->fifo);
err_stop: err_stop:
return error; return error;
} }
static int acpi_fujitsu_hotkey_remove(struct acpi_device *device) static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
{ {
struct fujitsu_hotkey_t *fujitsu_hotkey = acpi_driver_data(device); struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device);
struct input_dev *input = fujitsu_hotkey->input; struct input_dev *input = fujitsu_laptop->input;
#if IS_ENABLED(CONFIG_LEDS_CLASS) #if IS_ENABLED(CONFIG_LEDS_CLASS)
if (fujitsu_hotkey->logolamp_registered) if (fujitsu_laptop->logolamp_registered)
led_classdev_unregister(&logolamp_led); led_classdev_unregister(&logolamp_led);
if (fujitsu_hotkey->kblamps_registered) if (fujitsu_laptop->kblamps_registered)
led_classdev_unregister(&kblamps_led); led_classdev_unregister(&kblamps_led);
if (fujitsu_hotkey->radio_led_registered) if (fujitsu_laptop->radio_led_registered)
led_classdev_unregister(&radio_led); led_classdev_unregister(&radio_led);
if (fujitsu_hotkey->eco_led_registered) if (fujitsu_laptop->eco_led_registered)
led_classdev_unregister(&eco_led); led_classdev_unregister(&eco_led);
#endif #endif
input_unregister_device(input); input_unregister_device(input);
kfifo_free(&fujitsu_hotkey->fifo); kfifo_free(&fujitsu_laptop->fifo);
fujitsu_hotkey->acpi_handle = NULL; fujitsu_laptop->acpi_handle = NULL;
return 0; return 0;
} }
static void acpi_fujitsu_hotkey_press(int keycode) static void acpi_fujitsu_laptop_press(int keycode)
{ {
struct input_dev *input = fujitsu_hotkey->input; struct input_dev *input = fujitsu_laptop->input;
int status; int status;
status = kfifo_in_locked(&fujitsu_hotkey->fifo, status = kfifo_in_locked(&fujitsu_laptop->fifo,
(unsigned char *)&keycode, sizeof(keycode), (unsigned char *)&keycode, sizeof(keycode),
&fujitsu_hotkey->fifo_lock); &fujitsu_laptop->fifo_lock);
if (status != sizeof(keycode)) { if (status != sizeof(keycode)) {
vdbg_printk(FUJLAPTOP_DBG_WARN, vdbg_printk(FUJLAPTOP_DBG_WARN,
"Could not push keycode [0x%x]\n", keycode); "Could not push keycode [0x%x]\n", keycode);
...@@ -1054,16 +1054,16 @@ static void acpi_fujitsu_hotkey_press(int keycode) ...@@ -1054,16 +1054,16 @@ static void acpi_fujitsu_hotkey_press(int keycode)
"Push keycode into ringbuffer [%d]\n", keycode); "Push keycode into ringbuffer [%d]\n", keycode);
} }
static void acpi_fujitsu_hotkey_release(void) static void acpi_fujitsu_laptop_release(void)
{ {
struct input_dev *input = fujitsu_hotkey->input; struct input_dev *input = fujitsu_laptop->input;
int keycode, status; int keycode, status;
while (true) { while (true) {
status = kfifo_out_locked(&fujitsu_hotkey->fifo, status = kfifo_out_locked(&fujitsu_laptop->fifo,
(unsigned char *)&keycode, (unsigned char *)&keycode,
sizeof(keycode), sizeof(keycode),
&fujitsu_hotkey->fifo_lock); &fujitsu_laptop->fifo_lock);
if (status != sizeof(keycode)) if (status != sizeof(keycode))
return; return;
input_report_key(input, keycode, 0); input_report_key(input, keycode, 0);
...@@ -1073,14 +1073,14 @@ static void acpi_fujitsu_hotkey_release(void) ...@@ -1073,14 +1073,14 @@ static void acpi_fujitsu_hotkey_release(void)
} }
} }
static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
{ {
struct input_dev *input; struct input_dev *input;
int keycode; int keycode;
unsigned int irb = 1; unsigned int irb = 1;
int i; int i;
input = fujitsu_hotkey->input; input = fujitsu_laptop->input;
if (event != ACPI_FUJITSU_NOTIFY_CODE1) { if (event != ACPI_FUJITSU_NOTIFY_CODE1) {
keycode = KEY_UNKNOWN; keycode = KEY_UNKNOWN;
...@@ -1093,8 +1093,8 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) ...@@ -1093,8 +1093,8 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
return; return;
} }
if (fujitsu_hotkey->rfkill_supported) if (fujitsu_laptop->rfkill_supported)
fujitsu_hotkey->rfkill_state = fujitsu_laptop->rfkill_state =
call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
i = 0; i = 0;
...@@ -1128,16 +1128,16 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) ...@@ -1128,16 +1128,16 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
} }
if (keycode > 0) if (keycode > 0)
acpi_fujitsu_hotkey_press(keycode); acpi_fujitsu_laptop_press(keycode);
else if (keycode == 0) else if (keycode == 0)
acpi_fujitsu_hotkey_release(); acpi_fujitsu_laptop_release();
} }
/* On some models (first seen on the Skylake-based Lifebook /* On some models (first seen on the Skylake-based Lifebook
* E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is * E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is
* handled in software; its state is queried using FUNC_RFKILL * handled in software; its state is queried using FUNC_RFKILL
*/ */
if ((fujitsu_hotkey->rfkill_supported & BIT(26)) && if ((fujitsu_laptop->rfkill_supported & BIT(26)) &&
(call_fext_func(FUNC_RFKILL, 0x1, 0x0, 0x0) & BIT(26))) { (call_fext_func(FUNC_RFKILL, 0x1, 0x0, 0x0) & BIT(26))) {
keycode = KEY_TOUCHPAD_TOGGLE; keycode = KEY_TOUCHPAD_TOGGLE;
input_report_key(input, keycode, 1); input_report_key(input, keycode, 1);
...@@ -1166,25 +1166,25 @@ static struct acpi_driver acpi_fujitsu_bl_driver = { ...@@ -1166,25 +1166,25 @@ static struct acpi_driver acpi_fujitsu_bl_driver = {
}, },
}; };
static const struct acpi_device_id fujitsu_hotkey_device_ids[] = { static const struct acpi_device_id fujitsu_laptop_device_ids[] = {
{ACPI_FUJITSU_HOTKEY_HID, 0}, {ACPI_FUJITSU_LAPTOP_HID, 0},
{"", 0}, {"", 0},
}; };
static struct acpi_driver acpi_fujitsu_hotkey_driver = { static struct acpi_driver acpi_fujitsu_laptop_driver = {
.name = ACPI_FUJITSU_HOTKEY_DRIVER_NAME, .name = ACPI_FUJITSU_LAPTOP_DRIVER_NAME,
.class = ACPI_FUJITSU_CLASS, .class = ACPI_FUJITSU_CLASS,
.ids = fujitsu_hotkey_device_ids, .ids = fujitsu_laptop_device_ids,
.ops = { .ops = {
.add = acpi_fujitsu_hotkey_add, .add = acpi_fujitsu_laptop_add,
.remove = acpi_fujitsu_hotkey_remove, .remove = acpi_fujitsu_laptop_remove,
.notify = acpi_fujitsu_hotkey_notify, .notify = acpi_fujitsu_laptop_notify,
}, },
}; };
static const struct acpi_device_id fujitsu_ids[] __used = { static const struct acpi_device_id fujitsu_ids[] __used = {
{ACPI_FUJITSU_BL_HID, 0}, {ACPI_FUJITSU_BL_HID, 0},
{ACPI_FUJITSU_HOTKEY_HID, 0}, {ACPI_FUJITSU_LAPTOP_HID, 0},
{"", 0} {"", 0}
}; };
MODULE_DEVICE_TABLE(acpi, fujitsu_ids); MODULE_DEVICE_TABLE(acpi, fujitsu_ids);
...@@ -1255,18 +1255,18 @@ static int __init fujitsu_init(void) ...@@ -1255,18 +1255,18 @@ static int __init fujitsu_init(void)
if (ret) if (ret)
goto fail_backlight; goto fail_backlight;
/* Register hotkey driver */ /* Register laptop driver */
fujitsu_hotkey = kzalloc(sizeof(struct fujitsu_hotkey_t), GFP_KERNEL); fujitsu_laptop = kzalloc(sizeof(struct fujitsu_laptop), GFP_KERNEL);
if (!fujitsu_hotkey) { if (!fujitsu_laptop) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail_hotkey; goto fail_laptop;
} }
result = acpi_bus_register_driver(&acpi_fujitsu_hotkey_driver); result = acpi_bus_register_driver(&acpi_fujitsu_laptop_driver);
if (result < 0) { if (result < 0) {
ret = -ENODEV; ret = -ENODEV;
goto fail_hotkey1; goto fail_laptop1;
} }
/* Sync backlight power status (needs FUJ02E3 device, hence deferred) */ /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
...@@ -1281,9 +1281,9 @@ static int __init fujitsu_init(void) ...@@ -1281,9 +1281,9 @@ static int __init fujitsu_init(void)
return 0; return 0;
fail_hotkey1: fail_laptop1:
kfree(fujitsu_hotkey); kfree(fujitsu_laptop);
fail_hotkey: fail_laptop:
platform_driver_unregister(&fujitsupf_driver); platform_driver_unregister(&fujitsupf_driver);
fail_backlight: fail_backlight:
backlight_device_unregister(fujitsu_bl->bl_device); backlight_device_unregister(fujitsu_bl->bl_device);
...@@ -1304,9 +1304,9 @@ static int __init fujitsu_init(void) ...@@ -1304,9 +1304,9 @@ static int __init fujitsu_init(void)
static void __exit fujitsu_cleanup(void) static void __exit fujitsu_cleanup(void)
{ {
acpi_bus_unregister_driver(&acpi_fujitsu_hotkey_driver); acpi_bus_unregister_driver(&acpi_fujitsu_laptop_driver);
kfree(fujitsu_hotkey); kfree(fujitsu_laptop);
platform_driver_unregister(&fujitsupf_driver); platform_driver_unregister(&fujitsupf_driver);
......
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