Input: sx8654 - use IRQF_NOAUTOEN when requesting interrupt

Instead of requesting interrupt normally and immediately disabling it
with call to disable_irq() use IRQF_NOAUTOEN to keep it disabled until
it is needed. This avoids a tiny window when interrupt is enabled but
not needed.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov
2024-08-14 14:22:13 -07:00
parent a8f56931c4
commit 600a2db76b

View File

@@ -391,9 +391,13 @@ static int sx8654_probe(struct i2c_client *client)
return error;
}
/*
* Start with the interrupt disabled, it will be enabled in
* sx8654_open().
*/
error = devm_request_threaded_irq(&client->dev, client->irq,
NULL, sx8654->data->irqh,
IRQF_ONESHOT,
IRQF_ONESHOT | IRQF_NO_AUTOEN,
client->name, sx8654);
if (error) {
dev_err(&client->dev,
@@ -402,9 +406,6 @@ static int sx8654_probe(struct i2c_client *client)
return error;
}
/* Disable the IRQ, we'll enable it in sx8654_open() */
disable_irq(client->irq);
error = input_register_device(sx8654->input);
if (error)
return error;