diff options
| author | Alan Cox <alan@linux.intel.com> | 2012-11-03 15:16:12 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-25 12:46:44 -0400 |
| commit | 04848ba829b3b740c7c9ae0c5916f90efaed0f5d (patch) | |
| tree | 668d39617f9a9a5e2802caad82edd306cfe4669a | |
| parent | 41cc2aaf802ee21a3eb2c4bcb6995b3bb975bf87 (diff) | |
Input: tps6507x-ts - remove bogus unreachable code
tsc->polling is write only and the poll local is meaningless
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| -rw-r--r-- | drivers/input/touchscreen/tps6507x-ts.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index 820a066c3b8a..1fb397c42aa3 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c | |||
| @@ -42,7 +42,6 @@ struct tps6507x_ts { | |||
| 42 | struct device *dev; | 42 | struct device *dev; |
| 43 | char phys[32]; | 43 | char phys[32]; |
| 44 | struct delayed_work work; | 44 | struct delayed_work work; |
| 45 | unsigned polling; /* polling is active */ | ||
| 46 | struct ts_event tc; | 45 | struct ts_event tc; |
| 47 | struct tps6507x_dev *mfd; | 46 | struct tps6507x_dev *mfd; |
| 48 | u16 model; | 47 | u16 model; |
| @@ -168,7 +167,6 @@ static void tps6507x_ts_handler(struct work_struct *work) | |||
| 168 | struct input_dev *input_dev = tsc->input_dev; | 167 | struct input_dev *input_dev = tsc->input_dev; |
| 169 | int pendown; | 168 | int pendown; |
| 170 | int schd; | 169 | int schd; |
| 171 | int poll = 0; | ||
| 172 | s32 ret; | 170 | s32 ret; |
| 173 | 171 | ||
| 174 | ret = tps6507x_adc_conversion(tsc, TPS6507X_TSCMODE_PRESSURE, | 172 | ret = tps6507x_adc_conversion(tsc, TPS6507X_TSCMODE_PRESSURE, |
| @@ -209,24 +207,14 @@ static void tps6507x_ts_handler(struct work_struct *work) | |||
| 209 | input_report_abs(input_dev, ABS_PRESSURE, tsc->tc.pressure); | 207 | input_report_abs(input_dev, ABS_PRESSURE, tsc->tc.pressure); |
| 210 | input_sync(input_dev); | 208 | input_sync(input_dev); |
| 211 | tsc->pendown = 1; | 209 | tsc->pendown = 1; |
| 212 | poll = 1; | ||
| 213 | } | 210 | } |
| 214 | 211 | ||
| 215 | done: | 212 | done: |
| 216 | /* always poll if not using interrupts */ | 213 | /* always poll if not using interrupts */ |
| 217 | poll = 1; | 214 | schd = schedule_delayed_work(&tsc->work, |
| 218 | 215 | msecs_to_jiffies(tsc->poll_period)); | |
| 219 | if (poll) { | 216 | if (!schd) |
| 220 | schd = schedule_delayed_work(&tsc->work, | 217 | dev_err(tsc->dev, "re-schedule failed"); |
| 221 | msecs_to_jiffies(tsc->poll_period)); | ||
| 222 | if (schd) | ||
| 223 | tsc->polling = 1; | ||
| 224 | else { | ||
| 225 | tsc->polling = 0; | ||
| 226 | dev_err(tsc->dev, "re-schedule failed"); | ||
| 227 | } | ||
| 228 | } else | ||
| 229 | tsc->polling = 0; | ||
| 230 | 218 | ||
| 231 | ret = tps6507x_adc_standby(tsc); | 219 | ret = tps6507x_adc_standby(tsc); |
| 232 | } | 220 | } |
| @@ -324,10 +312,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev) | |||
| 324 | schd = schedule_delayed_work(&tsc->work, | 312 | schd = schedule_delayed_work(&tsc->work, |
| 325 | msecs_to_jiffies(tsc->poll_period)); | 313 | msecs_to_jiffies(tsc->poll_period)); |
| 326 | 314 | ||
| 327 | if (schd) | 315 | if (!schd) { |
| 328 | tsc->polling = 1; | ||
| 329 | else { | ||
| 330 | tsc->polling = 0; | ||
| 331 | dev_err(tsc->dev, "schedule failed"); | 316 | dev_err(tsc->dev, "schedule failed"); |
| 332 | goto err2; | 317 | goto err2; |
| 333 | } | 318 | } |
