提交 a5df8025 编写于 作者: V Vincent Knecht 提交者: Dmitry Torokhov

Input: msg2638 - only read linux,keycodes array if necessary

The linux,keycodes property is optional.
Fix the driver not probing when it's not specified.

Fixes: c18ef503 ("Input: msg2638 - add support for msg2138 key events")
Signed-off-by: NVincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20221130210202.2069213-1-vincent.knecht@mailoo.orgSigned-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 b2b80d9d
...@@ -412,13 +412,15 @@ static int msg2638_ts_probe(struct i2c_client *client) ...@@ -412,13 +412,15 @@ static int msg2638_ts_probe(struct i2c_client *client)
msg2638->num_keycodes = ARRAY_SIZE(msg2638->keycodes); msg2638->num_keycodes = ARRAY_SIZE(msg2638->keycodes);
} }
error = device_property_read_u32_array(dev, "linux,keycodes", if (msg2638->num_keycodes > 0) {
msg2638->keycodes, error = device_property_read_u32_array(dev, "linux,keycodes",
msg2638->num_keycodes); msg2638->keycodes,
if (error) { msg2638->num_keycodes);
dev_err(dev, "Unable to read linux,keycodes values: %d\n", if (error) {
error); dev_err(dev, "Unable to read linux,keycodes values: %d\n",
return error; error);
return error;
}
} }
error = devm_request_threaded_irq(dev, client->irq, error = devm_request_threaded_irq(dev, client->irq,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册