linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] tps6507: remove bogus unreachable code
@ 2012-10-25 14:28 Alan Cox
  2012-10-25 18:03 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-10-25 14:28 UTC (permalink / raw)
  To: linux-input

From: Alan Cox <alan@linux.intel.com>

tsc->polling is write only and the poll local is meaningless

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/input/touchscreen/tps6507x-ts.c |   25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index f7eda3d..27f95ad 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -42,7 +42,6 @@ struct tps6507x_ts {
 	struct device		*dev;
 	char			phys[32];
 	struct delayed_work	work;
-	unsigned		polling;	/* polling is active */
 	struct ts_event		tc;
 	struct tps6507x_dev	*mfd;
 	u16			model;
@@ -168,7 +167,6 @@ static void tps6507x_ts_handler(struct work_struct *work)
 	struct input_dev *input_dev = tsc->input_dev;
 	int pendown;
 	int schd;
-	int poll = 0;
 	s32 ret;
 
 	ret =  tps6507x_adc_conversion(tsc, TPS6507X_TSCMODE_PRESSURE,
@@ -209,24 +207,14 @@ static void tps6507x_ts_handler(struct work_struct *work)
 		input_report_abs(input_dev, ABS_PRESSURE, tsc->tc.pressure);
 		input_sync(input_dev);
 		tsc->pendown = 1;
-		poll = 1;
 	}
 
 done:
 	/* always poll if not using interrupts */
-	poll = 1;
-
-	if (poll) {
-		schd = schedule_delayed_work(&tsc->work,
-					msecs_to_jiffies(tsc->poll_period));
-		if (schd)
-			tsc->polling = 1;
-		else {
-			tsc->polling = 0;
-			dev_err(tsc->dev, "re-schedule failed");
-		}
-	} else
-		tsc->polling = 0;
+	schd = schedule_delayed_work(&tsc->work,
+				msecs_to_jiffies(tsc->poll_period));
+	if (!schd)
+		dev_err(tsc->dev, "re-schedule failed");
 
 	ret = tps6507x_adc_standby(tsc);
 }
@@ -324,10 +312,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
 	schd = schedule_delayed_work(&tsc->work,
 				     msecs_to_jiffies(tsc->poll_period));
 
-	if (schd)
-		tsc->polling = 1;
-	else {
-		tsc->polling = 0;
+	if (!schd) {
 		dev_err(tsc->dev, "schedule failed");
 		goto err2;
 	 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] tps6507: remove bogus unreachable code
  2012-10-25 14:28 [PATCH RESEND] tps6507: remove bogus unreachable code Alan Cox
@ 2012-10-25 18:03 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2012-10-25 18:03 UTC (permalink / raw)
  To: Alan Cox, Todd Fischer; +Cc: linux-input

On Thu, Oct 25, 2012 at 03:28:51PM +0100, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
> 
> tsc->polling is write only and the poll local is meaningless
> 

Alan,

I could apply the patch, but a touchscreen driver without interrupt
support is not too useful...

Todd,

Is there a more mature version of this driver?

Thanks.

> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
> 
>  drivers/input/touchscreen/tps6507x-ts.c |   25 +++++--------------------
>  1 file changed, 5 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
> index f7eda3d..27f95ad 100644
> --- a/drivers/input/touchscreen/tps6507x-ts.c
> +++ b/drivers/input/touchscreen/tps6507x-ts.c
> @@ -42,7 +42,6 @@ struct tps6507x_ts {
>  	struct device		*dev;
>  	char			phys[32];
>  	struct delayed_work	work;
> -	unsigned		polling;	/* polling is active */
>  	struct ts_event		tc;
>  	struct tps6507x_dev	*mfd;
>  	u16			model;
> @@ -168,7 +167,6 @@ static void tps6507x_ts_handler(struct work_struct *work)
>  	struct input_dev *input_dev = tsc->input_dev;
>  	int pendown;
>  	int schd;
> -	int poll = 0;
>  	s32 ret;
>  
>  	ret =  tps6507x_adc_conversion(tsc, TPS6507X_TSCMODE_PRESSURE,
> @@ -209,24 +207,14 @@ static void tps6507x_ts_handler(struct work_struct *work)
>  		input_report_abs(input_dev, ABS_PRESSURE, tsc->tc.pressure);
>  		input_sync(input_dev);
>  		tsc->pendown = 1;
> -		poll = 1;
>  	}
>  
>  done:
>  	/* always poll if not using interrupts */
> -	poll = 1;
> -
> -	if (poll) {
> -		schd = schedule_delayed_work(&tsc->work,
> -					msecs_to_jiffies(tsc->poll_period));
> -		if (schd)
> -			tsc->polling = 1;
> -		else {
> -			tsc->polling = 0;
> -			dev_err(tsc->dev, "re-schedule failed");
> -		}
> -	} else
> -		tsc->polling = 0;
> +	schd = schedule_delayed_work(&tsc->work,
> +				msecs_to_jiffies(tsc->poll_period));
> +	if (!schd)
> +		dev_err(tsc->dev, "re-schedule failed");
>  
>  	ret = tps6507x_adc_standby(tsc);
>  }
> @@ -324,10 +312,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
>  	schd = schedule_delayed_work(&tsc->work,
>  				     msecs_to_jiffies(tsc->poll_period));
>  
> -	if (schd)
> -		tsc->polling = 1;
> -	else {
> -		tsc->polling = 0;
> +	if (!schd) {
>  		dev_err(tsc->dev, "schedule failed");
>  		goto err2;
>  	 }
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-25 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 14:28 [PATCH RESEND] tps6507: remove bogus unreachable code Alan Cox
2012-10-25 18:03 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).