Commit 3c92e38d authored by Szymon Janc's avatar Szymon Janc Committed by Greg Kroah-Hartman

Staging: quickstart: Rename quickstart_btn to quickstart_button

Signed-off-by: default avatarSzymon Janc <szymon@janc.net.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 21c1ddf3
...@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL"); ...@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL");
#define QUICKSTART_EVENT_WAKE 0x02 #define QUICKSTART_EVENT_WAKE 0x02
#define QUICKSTART_EVENT_RUNTIME 0x80 #define QUICKSTART_EVENT_RUNTIME 0x80
struct quickstart_btn { struct quickstart_button {
char *name; char *name;
unsigned int id; unsigned int id;
struct list_head list; struct list_head list;
...@@ -60,11 +60,11 @@ struct quickstart_btn { ...@@ -60,11 +60,11 @@ struct quickstart_btn {
struct quickstart_acpi { struct quickstart_acpi {
struct acpi_device *device; struct acpi_device *device;
struct quickstart_btn *btn; struct quickstart_button *button;
}; };
static LIST_HEAD(buttons); static LIST_HEAD(buttons);
static struct quickstart_btn *pressed; static struct quickstart_button *pressed;
static struct input_dev *quickstart_input; static struct input_dev *quickstart_input;
...@@ -74,7 +74,7 @@ static ssize_t quickstart_buttons_show(struct device *dev, ...@@ -74,7 +74,7 @@ static ssize_t quickstart_buttons_show(struct device *dev,
char *buf) char *buf)
{ {
int count = 0; int count = 0;
struct quickstart_btn *b; struct quickstart_button *b;
if (list_empty(&buttons)) if (list_empty(&buttons))
return snprintf(buf, PAGE_SIZE, "none"); return snprintf(buf, PAGE_SIZE, "none");
...@@ -116,9 +116,9 @@ static ssize_t quickstart_pressed_button_store(struct device *dev, ...@@ -116,9 +116,9 @@ static ssize_t quickstart_pressed_button_store(struct device *dev,
} }
/* Helper functions */ /* Helper functions */
static struct quickstart_btn *quickstart_buttons_add(void) static struct quickstart_button *quickstart_buttons_add(void)
{ {
struct quickstart_btn *b; struct quickstart_button *b;
b = kzalloc(sizeof(*b), GFP_KERNEL); b = kzalloc(sizeof(*b), GFP_KERNEL);
if (!b) if (!b)
...@@ -129,7 +129,7 @@ static struct quickstart_btn *quickstart_buttons_add(void) ...@@ -129,7 +129,7 @@ static struct quickstart_btn *quickstart_buttons_add(void)
return b; return b;
} }
static void quickstart_button_del(struct quickstart_btn *data) static void quickstart_button_del(struct quickstart_button *data)
{ {
if (!data) if (!data)
return; return;
...@@ -141,7 +141,7 @@ static void quickstart_button_del(struct quickstart_btn *data) ...@@ -141,7 +141,7 @@ static void quickstart_button_del(struct quickstart_btn *data)
static void quickstart_buttons_free(void) static void quickstart_buttons_free(void)
{ {
struct quickstart_btn *b, *n; struct quickstart_button *b, *n;
list_for_each_entry_safe(b, n, &buttons, list) list_for_each_entry_safe(b, n, &buttons, list)
quickstart_button_del(b); quickstart_button_del(b);
...@@ -157,12 +157,12 @@ static void quickstart_acpi_notify(acpi_handle handle, u32 event, void *data) ...@@ -157,12 +157,12 @@ static void quickstart_acpi_notify(acpi_handle handle, u32 event, void *data)
switch (event) { switch (event) {
case QUICKSTART_EVENT_WAKE: case QUICKSTART_EVENT_WAKE:
pressed = quickstart->btn; pressed = quickstart->button;
break; break;
case QUICKSTART_EVENT_RUNTIME: case QUICKSTART_EVENT_RUNTIME:
input_report_key(quickstart_input, quickstart->btn->id, 1); input_report_key(quickstart_input, quickstart->button->id, 1);
input_sync(quickstart_input); input_sync(quickstart_input);
input_report_key(quickstart_input, quickstart->btn->id, 0); input_report_key(quickstart_input, quickstart->button->id, 0);
input_sync(quickstart_input); input_sync(quickstart_input);
break; break;
default: default:
...@@ -184,7 +184,7 @@ static int quickstart_acpi_ghid(struct quickstart_acpi *quickstart) ...@@ -184,7 +184,7 @@ static int quickstart_acpi_ghid(struct quickstart_acpi *quickstart)
&buffer); &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_ERR "quickstart: %s GHID method failed.\n", printk(KERN_ERR "quickstart: %s GHID method failed.\n",
quickstart->btn->name); quickstart->button->name);
return -EINVAL; return -EINVAL;
} }
...@@ -195,21 +195,21 @@ static int quickstart_acpi_ghid(struct quickstart_acpi *quickstart) ...@@ -195,21 +195,21 @@ static int quickstart_acpi_ghid(struct quickstart_acpi *quickstart)
*/ */
switch (buffer.length) { switch (buffer.length) {
case 1: case 1:
quickstart->btn->id = *(uint8_t *)buffer.pointer; quickstart->button->id = *(uint8_t *)buffer.pointer;
break; break;
case 2: case 2:
quickstart->btn->id = *(uint16_t *)buffer.pointer; quickstart->button->id = *(uint16_t *)buffer.pointer;
break; break;
case 4: case 4:
quickstart->btn->id = *(uint32_t *)buffer.pointer; quickstart->button->id = *(uint32_t *)buffer.pointer;
break; break;
case 8: case 8:
quickstart->btn->id = *(uint64_t *)buffer.pointer; quickstart->button->id = *(uint64_t *)buffer.pointer;
break; break;
default: default:
printk(KERN_ERR "quickstart: %s GHID method returned buffer " printk(KERN_ERR "quickstart: %s GHID method returned buffer "
"of unexpected length %u\n", "of unexpected length %u\n",
quickstart->btn->name, buffer.length); quickstart->button->name, buffer.length);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -229,14 +229,14 @@ static int quickstart_acpi_config(struct quickstart_acpi *quickstart) ...@@ -229,14 +229,14 @@ static int quickstart_acpi_config(struct quickstart_acpi *quickstart)
return -ENOMEM; return -ENOMEM;
/* Add new button to list */ /* Add new button to list */
quickstart->btn = quickstart_buttons_add(); quickstart->button = quickstart_buttons_add();
if (!quickstart->btn) { if (!quickstart->button) {
kfree(name); kfree(name);
return -ENOMEM; return -ENOMEM;
} }
quickstart->btn->name = name; quickstart->button->name = name;
strcpy(quickstart->btn->name, bid); strcpy(quickstart->button->name, bid);
return 0; return 0;
} }
...@@ -285,7 +285,7 @@ static int quickstart_acpi_add(struct acpi_device *device) ...@@ -285,7 +285,7 @@ static int quickstart_acpi_add(struct acpi_device *device)
quickstart_acpi_notify); quickstart_acpi_notify);
fail_installnotify: fail_installnotify:
quickstart_button_del(quickstart->btn); quickstart_button_del(quickstart->button);
fail_config: fail_config:
...@@ -362,7 +362,7 @@ static void quickstart_exit(void) ...@@ -362,7 +362,7 @@ static void quickstart_exit(void)
static int __init quickstart_init_input(void) static int __init quickstart_init_input(void)
{ {
struct quickstart_btn *b; struct quickstart_button *b;
int ret; int ret;
quickstart_input = input_allocate_device(); quickstart_input = input_allocate_device();
......
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