Merge tag 'input-for-v6.13-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - support for NT36672A touchscreen added to novatek-nvt-ts driver - a change to ads7846 driver to prevent XPT2046 from locking up - a change switching platform input dirves back to using remove() method (from remove_new()) - updates to a number of input drivers to use the new cleanup facilities (__free(...), guard(), and scoped-guard()) which ensure that the resources and locks are released properly and automatically - other assorted driver cleanups and fixes. * tag 'input-for-v6.13-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (109 commits) Input: mpr121 - use devm_regulator_get_enable_read_voltage() Input: sun4i-lradc-keys - don't include 'pm_wakeup.h' directly Input: spear-keyboard - don't include 'pm_wakeup.h' directly Input: cypress-sf - constify struct i2c_device_id Input: ads7846 - increase xfer array size in 'struct ser_req' Input: fix the input_event struct documentation Input: i8042 - fix typo dublicate to duplicate Input: ads7846 - add dummy command register clearing cycle Input: cs40l50 - fix wrong usage of INIT_WORK() Input: introduce notion of passive observers for input handlers Input: maple_keyb - use guard notation when acquiring mutex Input: locomokbd - use guard notation when acquiring spinlock Input: hilkbd - use guard notation when acquiring spinlock Input: synaptics-rmi4 - switch to using cleanup functions in F34 Input: synaptics - fix a typo dt-bindings: input: rotary-encoder: Fix "rotary-encoder,rollover" type Input: omap-keypad - use guard notation when acquiring mutex Input: imagis - fix warning regarding 'imagis_3038_data' being unused Input: userio - remove unneeded semicolon Input: sparcspkr - use cleanup facility for device_node ...
This commit is contained in:
@@ -605,6 +605,9 @@ int input_open_device(struct input_handle *handle)
|
||||
|
||||
handle->open++;
|
||||
|
||||
if (handle->handler->passive_observer)
|
||||
goto out;
|
||||
|
||||
if (dev->users++ || dev->inhibited) {
|
||||
/*
|
||||
* Device is already opened and/or inhibited,
|
||||
@@ -668,11 +671,13 @@ void input_close_device(struct input_handle *handle)
|
||||
|
||||
__input_release_device(handle);
|
||||
|
||||
if (!--dev->users && !dev->inhibited) {
|
||||
if (dev->poller)
|
||||
input_dev_poller_stop(dev->poller);
|
||||
if (dev->close)
|
||||
dev->close(dev);
|
||||
if (!handle->handler->passive_observer) {
|
||||
if (!--dev->users && !dev->inhibited) {
|
||||
if (dev->poller)
|
||||
input_dev_poller_stop(dev->poller);
|
||||
if (dev->close)
|
||||
dev->close(dev);
|
||||
}
|
||||
}
|
||||
|
||||
if (!--handle->open) {
|
||||
|
||||
Reference in New Issue
Block a user