diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-28 02:29:25 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-07-02 23:40:47 -0400 |
commit | 57691a1e27a7d1995775b7e25e2ec0d7a415edc0 (patch) | |
tree | 676c2aac68b0459803a8ceb626a8a23ab39f9d9f /drivers/input | |
parent | 67bf12ca50d524f9e225347fe63533562e2004de (diff) |
Input: ads7846 - make sure we do not change platform data
Let's declare platform data a const pointer so that we don't accitentally
change it. Also fetch it with dev_get_platdata().
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 84ccf140c1bb..5ff041995198 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -961,9 +961,9 @@ static int ads7846_resume(struct device *dev) | |||
961 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); | 961 | static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); |
962 | 962 | ||
963 | static int ads7846_setup_pendown(struct spi_device *spi, | 963 | static int ads7846_setup_pendown(struct spi_device *spi, |
964 | struct ads7846 *ts) | 964 | struct ads7846 *ts, |
965 | const struct ads7846_platform_data *pdata) | ||
965 | { | 966 | { |
966 | struct ads7846_platform_data *pdata = spi->dev.platform_data; | ||
967 | int err; | 967 | int err; |
968 | 968 | ||
969 | /* | 969 | /* |
@@ -1003,7 +1003,7 @@ static int ads7846_setup_pendown(struct spi_device *spi, | |||
1003 | * use formula #2 for pressure, not #3. | 1003 | * use formula #2 for pressure, not #3. |
1004 | */ | 1004 | */ |
1005 | static void ads7846_setup_spi_msg(struct ads7846 *ts, | 1005 | static void ads7846_setup_spi_msg(struct ads7846 *ts, |
1006 | const struct ads7846_platform_data *pdata) | 1006 | const struct ads7846_platform_data *pdata) |
1007 | { | 1007 | { |
1008 | struct spi_message *m = &ts->msg[0]; | 1008 | struct spi_message *m = &ts->msg[0]; |
1009 | struct spi_transfer *x = ts->xfer; | 1009 | struct spi_transfer *x = ts->xfer; |
@@ -1203,10 +1203,10 @@ static void ads7846_setup_spi_msg(struct ads7846 *ts, | |||
1203 | 1203 | ||
1204 | static int ads7846_probe(struct spi_device *spi) | 1204 | static int ads7846_probe(struct spi_device *spi) |
1205 | { | 1205 | { |
1206 | const struct ads7846_platform_data *pdata = dev_get_platdata(&spi->dev); | ||
1206 | struct ads7846 *ts; | 1207 | struct ads7846 *ts; |
1207 | struct ads7846_packet *packet; | 1208 | struct ads7846_packet *packet; |
1208 | struct input_dev *input_dev; | 1209 | struct input_dev *input_dev; |
1209 | struct ads7846_platform_data *pdata = spi->dev.platform_data; | ||
1210 | unsigned long irq_flags; | 1210 | unsigned long irq_flags; |
1211 | int err; | 1211 | int err; |
1212 | 1212 | ||
@@ -1281,7 +1281,7 @@ static int ads7846_probe(struct spi_device *spi) | |||
1281 | ts->filter = ads7846_no_filter; | 1281 | ts->filter = ads7846_no_filter; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | err = ads7846_setup_pendown(spi, ts); | 1284 | err = ads7846_setup_pendown(spi, ts, pdata); |
1285 | if (err) | 1285 | if (err) |
1286 | goto err_cleanup_filter; | 1286 | goto err_cleanup_filter; |
1287 | 1287 | ||