mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
staging: unisys: visorinput: no need to track open count
evdev_open_device() and evdev_close_device() (in evdev.c) already track the open count under lock, and will only call visorinput_open() on the first open and visorinput_close() on the last close. So this patch removes the unnessary logic from visorinput, and the now-unused counter from the struct. Signed-off-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1b756c43ce
commit
7eb1f7a09b
1 changed files with 4 additions and 14 deletions
|
@ -66,7 +66,6 @@ struct visorinput_devdata {
|
||||||
struct rw_semaphore lock_visor_dev; /* lock for dev */
|
struct rw_semaphore lock_visor_dev; /* lock for dev */
|
||||||
struct input_dev *visorinput_dev;
|
struct input_dev *visorinput_dev;
|
||||||
bool paused;
|
bool paused;
|
||||||
unsigned int opened;
|
|
||||||
unsigned int keycode_table_bytes; /* size of following array */
|
unsigned int keycode_table_bytes; /* size of following array */
|
||||||
/* for keyboard devices: visorkbd_keycode[] + visorkbd_ext_keycode[] */
|
/* for keyboard devices: visorkbd_keycode[] + visorkbd_ext_keycode[] */
|
||||||
unsigned char keycode_table[0];
|
unsigned char keycode_table[0];
|
||||||
|
@ -227,11 +226,8 @@ static int visorinput_open(struct input_dev *visorinput_dev)
|
||||||
__func__, visorinput_dev);
|
__func__, visorinput_dev);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
devdata->opened++;
|
dev_dbg(&visorinput_dev->dev, "%s opened\n", __func__);
|
||||||
dev_dbg(&visorinput_dev->dev, "%s opened %d\n", __func__,
|
visorbus_enable_channel_interrupts(devdata->dev);
|
||||||
devdata->opened);
|
|
||||||
if (devdata->opened == 1)
|
|
||||||
visorbus_enable_channel_interrupts(devdata->dev);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,14 +240,8 @@ static void visorinput_close(struct input_dev *visorinput_dev)
|
||||||
__func__, visorinput_dev);
|
__func__, visorinput_dev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (devdata->opened) {
|
dev_dbg(&visorinput_dev->dev, "%s closed\n", __func__);
|
||||||
devdata->opened--;
|
visorbus_disable_channel_interrupts(devdata->dev);
|
||||||
dev_dbg(&visorinput_dev->dev, "%s closed %d\n", __func__,
|
|
||||||
devdata->opened);
|
|
||||||
if (devdata->opened == 0)
|
|
||||||
visorbus_disable_channel_interrupts(devdata->dev);
|
|
||||||
} else
|
|
||||||
dev_err(&visorinput_dev->dev, "%s not open\n", __func__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue