Re: [PATCH 1/3] input: gpio-keys: Remove extra call to input_sync

2021-03-05 Thread Dmitry Torokhov
On Fri, Mar 05, 2021 at 05:01:09PM +, Paul Cercueil wrote:
> The input_sync() function will already be called within
> gpio_keys_gpio_report_event(), so there's no need to call it again after
> the loop in gpio_keys_report_state().

I'd probably go other way around and remove the sync from
gpio_keys_report_state() and add one to gpio_keys_gpio_work_func() so
that we do not have to send bunch of input_sync() when there are several
keys/buttons.

Thanks.

-- 
Dmitry


[PATCH 1/3] input: gpio-keys: Remove extra call to input_sync

2021-03-05 Thread Paul Cercueil
The input_sync() function will already be called within
gpio_keys_gpio_report_event(), so there's no need to call it again after
the loop in gpio_keys_report_state().

Signed-off-by: Paul Cercueil 
---
 drivers/input/keyboard/gpio_keys.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c 
b/drivers/input/keyboard/gpio_keys.c
index 77bac4ddf324..0be204693ab0 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -641,7 +641,6 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 
 static void gpio_keys_report_state(struct gpio_keys_drvdata *ddata)
 {
-   struct input_dev *input = ddata->input;
int i;
 
for (i = 0; i < ddata->pdata->nbuttons; i++) {
@@ -649,7 +648,6 @@ static void gpio_keys_report_state(struct gpio_keys_drvdata 
*ddata)
if (bdata->gpiod)
gpio_keys_gpio_report_event(bdata);
}
-   input_sync(input);
 }
 
 static int gpio_keys_open(struct input_dev *input)
-- 
2.30.1