Commit a5df8025 authored by Vincent Knecht's avatar Vincent Knecht Committed by Dmitry Torokhov
Browse files

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: default avatarVincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20221130210202.2069213-1-vincent.knecht@mailoo.org


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent b2b80d9d
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -412,6 +412,7 @@ static int msg2638_ts_probe(struct i2c_client *client)
		msg2638->num_keycodes = ARRAY_SIZE(msg2638->keycodes);
	}

	if (msg2638->num_keycodes > 0) {
		error = device_property_read_u32_array(dev, "linux,keycodes",
						       msg2638->keycodes,
						       msg2638->num_keycodes);
@@ -420,6 +421,7 @@ static int msg2638_ts_probe(struct i2c_client *client)
				error);
			return error;
		}
	}

	error = devm_request_threaded_irq(dev, client->irq,
					  NULL, chip_data->irq_handler,