* [PATCH RESEND] Input: msg2638 - only read linux,keycodes array if necessary
@ 2022-11-30 21:01 Vincent Knecht
2022-11-30 23:15 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Knecht @ 2022-11-30 21:01 UTC (permalink / raw)
To: Dmitry Torokhov, Vincent Knecht, linux-input, linux-kernel
Cc: w.david0, stephan, phone-devel
The linux,keycodes property is optional.
Fix the driver not probing when it's not specified.
Fixes: c18ef50346f2 ("Input: msg2638 - add support for msg2138 key events")
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
Resending because of mailing issue,
ie. not appearing on mailing lists.
---
drivers/input/touchscreen/msg2638.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c
index 51b1c0e8a761..4c0816b09d33 100644
--- a/drivers/input/touchscreen/msg2638.c
+++ b/drivers/input/touchscreen/msg2638.c
@@ -412,13 +412,15 @@ static int msg2638_ts_probe(struct i2c_client *client)
msg2638->num_keycodes = ARRAY_SIZE(msg2638->keycodes);
}
- error = device_property_read_u32_array(dev, "linux,keycodes",
- msg2638->keycodes,
- msg2638->num_keycodes);
- if (error) {
- dev_err(dev, "Unable to read linux,keycodes values: %d\n",
- error);
- return error;
+ if (msg2638->num_keycodes > 0) {
+ error = device_property_read_u32_array(dev, "linux,keycodes",
+ msg2638->keycodes,
+ msg2638->num_keycodes);
+ if (error) {
+ dev_err(dev, "Unable to read linux,keycodes values: %d\n",
+ error);
+ return error;
+ }
}
error = devm_request_threaded_irq(dev, client->irq,
--
2.38.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] Input: msg2638 - only read linux,keycodes array if necessary
2022-11-30 21:01 [PATCH RESEND] Input: msg2638 - only read linux,keycodes array if necessary Vincent Knecht
@ 2022-11-30 23:15 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2022-11-30 23:15 UTC (permalink / raw)
To: Vincent Knecht; +Cc: linux-input, linux-kernel, w.david0, stephan, phone-devel
On Wed, Nov 30, 2022 at 10:01:59PM +0100, Vincent Knecht wrote:
> The linux,keycodes property is optional.
> Fix the driver not probing when it's not specified.
>
> Fixes: c18ef50346f2 ("Input: msg2638 - add support for msg2138 key events")
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-30 23:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 21:01 [PATCH RESEND] Input: msg2638 - only read linux,keycodes array if necessary Vincent Knecht
2022-11-30 23:15 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).