public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Komal Shah <komal_shah802003@yahoo.com>
Cc: Mikko.Soikkala@tietoenator.com, linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] Convert touchscreen to input_allocate_device
Date: Fri, 20 Jan 2006 15:07:29 -0800	[thread overview]
Message-ID: <20060120230729.GD6683@atomide.com> (raw)
In-Reply-To: <20060118163932.15056.qmail@web32901.mail.mud.yahoo.com>

* Komal Shah <komal_shah802003@yahoo.com> [060118 08:47]:
> --- Juha Yrjölä <juha.yrjola@nokia.com> wrote:
> 
> > 
> > Not quite yet. =) If you allocate the input device earlier, you also
> > have to
> > take care in deallocating it in the error paths after it.
> 
> Ok. Please check the attached patch. Build for OSK. 
> 
> Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
> 
> 
> ---Komal Shah
> http://komalshah.blogspot.com/
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
Content-Description: 1479429603-tsfix.patch
> diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
> diff --git a/drivers/input/touchscreen/omap/omap_ts.c b/drivers/input/touchscreen/omap/omap_ts.c
> index 5916245..f55ea05 100644
> --- a/drivers/input/touchscreen/omap/omap_ts.c
> +++ b/drivers/input/touchscreen/omap/omap_ts.c
> @@ -133,6 +133,12 @@ static int __init omap_ts_probe(struct p
>  	int status = -ENODEV;
>  
>  	memset(&ts_omap, 0, sizeof(ts_omap));
> +	
> +	ts_omap.inputdevice = input_allocate_device();
> +	if (!ts_omap.inputdevice) {
> +		return -ENOMEM;
> +	}
> +
>  	spin_lock_init(&ts_omap.lock);
>  
>  	for (i = 0; i < ARRAY_SIZE(ts_devs); i++) {
> @@ -145,8 +151,10 @@ static int __init omap_ts_probe(struct p
>  		}
>  	}
>  
> -	if (status != 0)
> +	if (status != 0) {
> +	    	input_free_device(ts_omap.inputdevice);
>  		return status;
> +	}
>  
>  	// Init acquisition timer function
>  	init_timer(&ts_omap.ts_timer);
> @@ -159,15 +167,18 @@ static int __init omap_ts_probe(struct p
>  			printk(KERN_ERR
>  	  "omap_ts.c: Could not allocate touchscreen IRQ!\n");
>  			ts_omap.irq = -1;
> +			ts_omap.dev->remove();
> +			input_free_device(ts_omap.inputdevice);
>  			return -EINVAL;
>  		}
>  		ts_omap.irq_enabled = 1;
>  	} else {
>  		printk(KERN_ERR "omap_ts.c: No touchscreen IRQ assigned!\n");
> +		ts_omap.dev->remove();
> +		input_free_device(ts_omap.inputdevice);
>  		return -EINVAL;
>  	}
>  
> -	ts_omap.inputdevice = input_allocate_device();
>  	ts_omap.inputdevice->name = OMAP_TS_NAME;
>  	ts_omap.inputdevice->dev = &pdev->dev;
>  	ts_omap.inputdevice->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);

Pushing today.

Tony

  reply	other threads:[~2006-01-20 23:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18  9:34 [PATCH] Convert touchscreen to input_allocate_device Mikko.Soikkala
2006-01-18 10:10 ` Komal Shah
2006-01-18 11:21   ` Juha Yrjölä
2006-01-18 16:39     ` Komal Shah
2006-01-20 23:07       ` Tony Lindgren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-17 13:24 Mikko.Soikkala
2006-01-17 15:12 ` Komal Shah
2006-01-16 11:59 Mikko.Soikkala
2006-01-16 18:15 ` Dirk Behme
2005-12-27  9:51 Pending patches Dirk Behme
2005-12-30 22:28 ` Tony Lindgren
2006-01-03 19:13   ` Pending patches mostly pushed, please check Tony Lindgren
2006-01-06 19:37     ` [PATCH] Convert touchscreen to input_allocate_device Dirk Behme
2006-01-14  0:18       ` Tony Lindgren
2005-12-04 15:52 Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060120230729.GD6683@atomide.com \
    --to=tony@atomide.com \
    --cc=Mikko.Soikkala@tietoenator.com \
    --cc=komal_shah802003@yahoo.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox