Commit 8ffef3cc authored by LABBE Corentin's avatar LABBE Corentin Committed by Dmitry Torokhov

Input: pixcir_i2c_ts - simplify code with of_device_get_match_data

The usage of of_device_get_match_data reduce the code size a bit.
Furthermore, it is better to use a standard function for
getting the match data.
Signed-off-by: default avatarLABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d1871654
...@@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[]; ...@@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[];
static int pixcir_parse_dt(struct device *dev, static int pixcir_parse_dt(struct device *dev,
struct pixcir_i2c_ts_data *tsdata) struct pixcir_i2c_ts_data *tsdata)
{ {
const struct of_device_id *match; tsdata->chip = of_device_get_match_data(dev);
match = of_match_device(of_match_ptr(pixcir_of_match), dev);
if (!match)
return -EINVAL;
tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data;
if (!tsdata->chip) if (!tsdata->chip)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment