summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2016-08-19 10:16:51 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-08-22 14:16:29 -0700
commit8ffef3cc696e9eff67ec79be349407895bffdfc1 (patch)
tree745d823d9cfda47b91e2112bdbd118f46e340ff3 /drivers/input
parentd18716542d137beafef2859bdf90d4e0c9a25523 (diff)
downloadlinux-8ffef3cc696e9eff67ec79be349407895bffdfc1.tar.gz
linux-8ffef3cc696e9eff67ec79be349407895bffdfc1.tar.bz2
linux-8ffef3cc696e9eff67ec79be349407895bffdfc1.zip
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: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/pixcir_i2c_ts.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index d159e14f4d20..b0a2dc2fbe08 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[];
static int pixcir_parse_dt(struct device *dev,
struct pixcir_i2c_ts_data *tsdata)
{
- const struct of_device_id *match;
-
- 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;
+ tsdata->chip = of_device_get_match_data(dev);
if (!tsdata->chip)
return -EINVAL;