struct quickstart_btn *btn;
};
-static struct quickstart_driver_data {
- struct quickstart_btn *btn_lst;
- struct quickstart_btn *pressed;
-} quickstart_data;
+static struct quickstart_btn *btn_list;
+static struct quickstart_btn *pressed;
static struct input_dev *quickstart_input;
char *buf)
{
int count = 0;
- struct quickstart_btn *ptr = quickstart_data.btn_lst;
+ struct quickstart_btn *ptr = btn_list;
if (!ptr)
return snprintf(buf, PAGE_SIZE, "none");
char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n",
- (quickstart_data.pressed ?
- quickstart_data.pressed->name : "none"));
+ (pressed ? pressed->name : "none"));
}
if (strncasecmp(buf, "none", 4) != 0)
return -EINVAL;
- quickstart_data.pressed = NULL;
+ pressed = NULL;
return count;
}
/* Helper functions */
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)
ptr = &((*ptr)->next);
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)
return;
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;
while (ptr) {
switch (event) {
case QUICKSTART_EVENT_WAKE:
- quickstart_data.pressed = quickstart->btn;
+ pressed = quickstart->btn;
break;
case QUICKSTART_EVENT_RUNTIME:
input_report_key(quickstart_input, quickstart->btn->id, 1);
static int __init quickstart_init_input(void)
{
- struct quickstart_btn **ptr = &quickstart_data.btn_lst;
+ struct quickstart_btn **ptr = &btn_list;
int count;
int ret;
return ret;
/* If existing bus with no devices */
- if (!quickstart_data.btn_lst) {
+ if (!btn_list) {
ret = -ENODEV;
goto fail_pfdrv_reg;
}