thermal: adc-tm: Ensure valid match data is obtained

Ensure that a valid compatible string match is obtained during probe
before reading any further device tree parameters.

Change-Id: Idd03cfce6cc2011052ffc7fb776d7be935214172
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
This commit is contained in:
Guru Das Srinagesh 2020-05-20 17:20:55 -07:00
commit 10cd1eb248

View file

@ -214,6 +214,9 @@ static int adc_tm_get_dt_data(struct platform_device *pdev,
return -EINVAL;
id = of_match_node(adc_tm_match_table, node);
if (!id)
return -EINVAL;
adc_tm->data = id->data;
adc_tm->ops = adc_tm->data->ops;