]> git.baikalelectronics.ru Git - kernel.git/commit
Input: stmfts - do not leave device disabled in stmfts_input_open
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 May 2022 16:51:08 +0000 (09:51 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 26 May 2022 16:57:07 +0000 (09:57 -0700)
commit67bcc5e09d931f9f61f8fd497a0ab983e2261277
tree72da1df9979246b53af0a16ab2534a9b44d77b5e
parentc33d5e7761085c390d78821fea6d46b8d8d4f586
Input: stmfts - do not leave device disabled in stmfts_input_open

The commit f0b5f1899f84 attempted to deal with potential leak of runtime
PM counter when opening the touchscreen device, however it ended up
erroneously dropping the counter in the case of successfully enabling the
device.

Let's address this by using pm_runtime_resume_and_get() and then executing
pm_runtime_put_sync() only when we fail to send "sense on" command to the
device.

Fixes: f0b5f1899f84 ("Input: stmfts - fix reference leak in stmfts_input_open")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/stmfts.c