Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1464578
| From | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data |
| Date | 2016-08-17 15:30 +0200 |
| Message-ID | <s794S-1zw-19@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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>
---
drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index d159e14..b0a2dc2 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;
--
2.7.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
[PATCH 3/3] input: pixcir_i2c: Remove a useless blank line LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
Re: [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200
[PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-17 15:30 +0200
Re: [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200
Re: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-08-19 19:20 +0200
csiph-web