input/hog: Fix double registering report value callbacks
authorSonny Sasaka <sonnysasaka@chromium.org>
Mon, 25 Jan 2021 19:33:54 +0000 (11:33 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
commit6f2de31e1c5e07e9aa101f17616dea0df9714103
treee25668cd589eec753520135cc0bdfb046c2ffec4
parent0dacb5b0ecbc787701956ed8000cad10bd3a73c7
input/hog: Fix double registering report value callbacks

In commit 23b69ab3e484 ("input/hog: Cache the HID report map"), we
optimized HOG reconnection by registering report value callbacks early,
but there was a bug where we also re-register the same report value
callbacks after at CCC write callback. We should handle this case by
avoiding the second callback register if we know we have done it
earlier.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/input/hog-lib.c