Commit 3991eae9 authored by Szymon Janc's avatar Szymon Janc Committed by Greg Kroah-Hartman

Staging: quickstart: Get rid of quickstart_data struct

Signed-off-by: default avatarSzymon Janc <szymon@janc.net.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a090832
...@@ -63,10 +63,8 @@ struct quickstart_acpi { ...@@ -63,10 +63,8 @@ struct quickstart_acpi {
struct quickstart_btn *btn; struct quickstart_btn *btn;
}; };
static struct quickstart_driver_data { static struct quickstart_btn *btn_list;
struct quickstart_btn *btn_lst; static struct quickstart_btn *pressed;
struct quickstart_btn *pressed;
} quickstart_data;
static struct input_dev *quickstart_input; static struct input_dev *quickstart_input;
...@@ -76,7 +74,7 @@ static ssize_t quickstart_buttons_show(struct device *dev, ...@@ -76,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 *ptr = quickstart_data.btn_lst; struct quickstart_btn *ptr = btn_list;
if (!ptr) if (!ptr)
return snprintf(buf, PAGE_SIZE, "none"); return snprintf(buf, PAGE_SIZE, "none");
...@@ -98,8 +96,7 @@ static ssize_t quickstart_pressed_button_show(struct device *dev, ...@@ -98,8 +96,7 @@ static ssize_t quickstart_pressed_button_show(struct device *dev,
char *buf) char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%s\n", return snprintf(buf, PAGE_SIZE, "%s\n",
(quickstart_data.pressed ? (pressed ? pressed->name : "none"));
quickstart_data.pressed->name : "none"));
} }
...@@ -113,14 +110,14 @@ static ssize_t quickstart_pressed_button_store(struct device *dev, ...@@ -113,14 +110,14 @@ static ssize_t quickstart_pressed_button_store(struct device *dev,
if (strncasecmp(buf, "none", 4) != 0) if (strncasecmp(buf, "none", 4) != 0)
return -EINVAL; return -EINVAL;
quickstart_data.pressed = NULL; pressed = NULL;
return count; return count;
} }
/* Helper functions */ /* Helper functions */
static int quickstart_btnlst_add(struct quickstart_btn **data) static int quickstart_btnlst_add(struct quickstart_btn **data)
{ {
struct quickstart_btn **ptr = &quickstart_data.btn_lst; struct quickstart_btn **ptr = &btn_list;
while (*ptr) while (*ptr)
ptr = &((*ptr)->next); ptr = &((*ptr)->next);
...@@ -137,7 +134,7 @@ static int quickstart_btnlst_add(struct quickstart_btn **data) ...@@ -137,7 +134,7 @@ static int quickstart_btnlst_add(struct quickstart_btn **data)
static void quickstart_btnlst_del(struct quickstart_btn *data) static void quickstart_btnlst_del(struct quickstart_btn *data)
{ {
struct quickstart_btn **ptr = &quickstart_data.btn_lst; struct quickstart_btn **ptr = &btn_list;
if (!data) if (!data)
return; return;
...@@ -156,7 +153,7 @@ static void quickstart_btnlst_del(struct quickstart_btn *data) ...@@ -156,7 +153,7 @@ static void quickstart_btnlst_del(struct quickstart_btn *data)
static void quickstart_btnlst_free(void) static void quickstart_btnlst_free(void)
{ {
struct quickstart_btn *ptr = quickstart_data.btn_lst; struct quickstart_btn *ptr = btn_list;
struct quickstart_btn *lptr = NULL; struct quickstart_btn *lptr = NULL;
while (ptr) { while (ptr) {
...@@ -179,7 +176,7 @@ static void quickstart_acpi_notify(acpi_handle handle, u32 event, void *data) ...@@ -179,7 +176,7 @@ static void quickstart_acpi_notify(acpi_handle handle, u32 event, void *data)
switch (event) { switch (event) {
case QUICKSTART_EVENT_WAKE: case QUICKSTART_EVENT_WAKE:
quickstart_data.pressed = quickstart->btn; pressed = quickstart->btn;
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->btn->id, 1);
...@@ -385,7 +382,7 @@ static void quickstart_exit(void) ...@@ -385,7 +382,7 @@ static void quickstart_exit(void)
static int __init quickstart_init_input(void) static int __init quickstart_init_input(void)
{ {
struct quickstart_btn **ptr = &quickstart_data.btn_lst; struct quickstart_btn **ptr = &btn_list;
int count; int count;
int ret; int ret;
...@@ -427,7 +424,7 @@ static int __init quickstart_init(void) ...@@ -427,7 +424,7 @@ static int __init quickstart_init(void)
return ret; return ret;
/* If existing bus with no devices */ /* If existing bus with no devices */
if (!quickstart_data.btn_lst) { if (!btn_list) {
ret = -ENODEV; ret = -ENODEV;
goto fail_pfdrv_reg; goto fail_pfdrv_reg;
} }
......
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