<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/rc/imon.c, branch v3.4.1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media</title>
<updated>2012-02-24T20:32:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-02-24T20:32:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e98092bedcfff1908ad7a32acc46f13e4d8b2f43'/>
<id>e98092bedcfff1908ad7a32acc46f13e4d8b2f43</id>
<content type='text'>
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] hdpvr: update picture controls to support firmware versions &gt; 0.15
  [media] wl128x: fix build errors when GPIOLIB is not enabled
  [media] hdpvr: fix race conditon during start of streaming
  [media] omap3isp: Fix crash caused by subdevs now having a pointer to devnodes
  [media] imon: don't wedge hardware after early callbacks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] hdpvr: update picture controls to support firmware versions &gt; 0.15
  [media] wl128x: fix build errors when GPIOLIB is not enabled
  [media] hdpvr: fix race conditon during start of streaming
  [media] omap3isp: Fix crash caused by subdevs now having a pointer to devnodes
  [media] imon: don't wedge hardware after early callbacks
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: don't wedge hardware after early callbacks</title>
<updated>2012-01-26T19:04:29+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2012-01-26T15:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8791d63af0cf113725ae4cb8cba9492814c59a93'/>
<id>8791d63af0cf113725ae4cb8cba9492814c59a93</id>
<content type='text'>
This patch is just a minor update to one titled "imon: Input from ffdc
device type ignored" from Corinna Vinschen. An earlier patch to prevent
an oops when we got early callbacks also has the nasty side-effect of
wedging imon hardware, as we don't acknowledge the urb. Rework the check
slightly here to bypass processing the packet, as the driver isn't yet
fully initialized, but still acknowlege the urb and submit a new rx_urb.
Do this for both interfaces -- irrelevant for ffdc hardware, but
relevant for newer hardware, though newer hardware doesn't spew the
constant stream of data as soon as the hardware is initialized like the
older ffdc devices, so they'd be less likely to trigger this anyway...

Tested with both an ffdc device and an 0042 device.

Reported-by: Corinna Vinschen &lt;vinschen@redhat.com&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is just a minor update to one titled "imon: Input from ffdc
device type ignored" from Corinna Vinschen. An earlier patch to prevent
an oops when we got early callbacks also has the nasty side-effect of
wedging imon hardware, as we don't acknowledge the urb. Rework the check
slightly here to bypass processing the packet, as the driver isn't yet
fully initialized, but still acknowlege the urb and submit a new rx_urb.
Do this for both interfaces -- irrelevant for ffdc hardware, but
relevant for newer hardware, though newer hardware doesn't spew the
constant stream of data as soon as the hardware is initialized like the
older ffdc devices, so they'd be less likely to trigger this anyway...

Tested with both an ffdc device and an 0042 device.

Reported-by: Corinna Vinschen &lt;vinschen@redhat.com&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: convert drivers/media/* to use module_usb_driver()</title>
<updated>2011-11-18T17:46:12+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2011-11-18T17:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ecb3b2b35db49778b6d89e3ffd0c400776c20735'/>
<id>ecb3b2b35db49778b6d89e3ffd0c400776c20735</id>
<content type='text'>
This converts the drivers in drivers/media/* to use the
module_usb_driver() macro which makes the code smaller and a bit
simpler.

Added bonus is that it removes some unneeded kernel log messages about
drivers loading and/or unloading.

Cc: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Cc: Luca Risolia &lt;luca.risolia@studio.unibo.it&gt;
Cc: Jean-Francois Moine &lt;moinejf@free.fr&gt;
Cc: Frank Zago &lt;frank@zago.net&gt;
Cc: Olivier Lorin &lt;o.lorin@laposte.net&gt;
Cc: Erik Andren &lt;erik.andren@gmail.com&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Brian Johnson &lt;brijohn@gmail.com&gt;
Cc: Leandro Costantino &lt;lcostantino@gmail.com&gt;
Cc: Antoine Jacquet &lt;royale@zerezo.com&gt;
Cc: Jarod Wilson &lt;jarod@redhat.com&gt;
Cc: Florian Mickler &lt;florian@mickler.org&gt;
Cc: Antti Palosaari &lt;crope@iki.fi&gt;
Cc: Michael Krufky &lt;mkrufky@kernellabs.com&gt;
Cc: "David Härdeman" &lt;david@hardeman.nu&gt;
Cc: Florent Audebert &lt;florent.audebert@anevia.com&gt;
Cc: Sam Doshi &lt;sam@metal-fish.co.uk&gt;
Cc: Manu Abraham &lt;manu@linuxtv.org&gt;
Cc: Olivier Grenie &lt;olivier.grenie@dibcom.fr&gt;
Cc: Patrick Boettcher &lt;patrick.boettcher@dibcom.fr&gt;
Cc: "Igor M. Liplianin" &lt;liplianin@me.by&gt;
Cc: Derek Kelly &lt;user.vdr@gmail.com&gt;
Cc: Malcolm Priestley &lt;tvboxspy@gmail.com&gt;
Cc: Steven Toth &lt;stoth@kernellabs.com&gt;
Cc: "André Weidemann" &lt;Andre.Weidemann@web.de&gt;
Cc: Martin Wilks &lt;m.wilks@technisat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jose Alberto Reguero &lt;jareguero@telefonica.net&gt;
Cc: David Henningsson &lt;david.henningsson@canonical.com&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Jesper Juhl &lt;jj@chaosbits.net&gt;
Cc: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
Cc: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Cc: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Cc: Anssi Hannula &lt;anssi.hannula@iki.fi&gt;
Cc: Rafi Rubin &lt;rafi@seas.upenn.edu&gt;
Cc: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: Paul Bender &lt;pebender@gmail.com&gt;
Cc: Devin Heitmueller &lt;dheitmueller@kernellabs.com&gt;
Cc: "Márcio A Alves" &lt;froooozen@gmail.com&gt;
Cc: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Chris Rankin &lt;rankincj@yahoo.com&gt;
Cc: Lee Jones &lt;lee.jones@canonical.com&gt;
Cc: Andy Walls &lt;awalls@md.metrocast.net&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Mike Frysinger &lt;vapier@gentoo.org&gt;
Cc: Dean Anderson &lt;linux-dev@sensoray.com&gt;
Cc: Pete Eberlein &lt;pete@sensoray.com&gt;
Cc: Arvydas Sidorenko &lt;asido4@gmail.com&gt;
Cc: Andrea Anacleto &lt;andreaanacleto@libero.it&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This converts the drivers in drivers/media/* to use the
module_usb_driver() macro which makes the code smaller and a bit
simpler.

Added bonus is that it removes some unneeded kernel log messages about
drivers loading and/or unloading.

Cc: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Cc: Luca Risolia &lt;luca.risolia@studio.unibo.it&gt;
Cc: Jean-Francois Moine &lt;moinejf@free.fr&gt;
Cc: Frank Zago &lt;frank@zago.net&gt;
Cc: Olivier Lorin &lt;o.lorin@laposte.net&gt;
Cc: Erik Andren &lt;erik.andren@gmail.com&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Brian Johnson &lt;brijohn@gmail.com&gt;
Cc: Leandro Costantino &lt;lcostantino@gmail.com&gt;
Cc: Antoine Jacquet &lt;royale@zerezo.com&gt;
Cc: Jarod Wilson &lt;jarod@redhat.com&gt;
Cc: Florian Mickler &lt;florian@mickler.org&gt;
Cc: Antti Palosaari &lt;crope@iki.fi&gt;
Cc: Michael Krufky &lt;mkrufky@kernellabs.com&gt;
Cc: "David Härdeman" &lt;david@hardeman.nu&gt;
Cc: Florent Audebert &lt;florent.audebert@anevia.com&gt;
Cc: Sam Doshi &lt;sam@metal-fish.co.uk&gt;
Cc: Manu Abraham &lt;manu@linuxtv.org&gt;
Cc: Olivier Grenie &lt;olivier.grenie@dibcom.fr&gt;
Cc: Patrick Boettcher &lt;patrick.boettcher@dibcom.fr&gt;
Cc: "Igor M. Liplianin" &lt;liplianin@me.by&gt;
Cc: Derek Kelly &lt;user.vdr@gmail.com&gt;
Cc: Malcolm Priestley &lt;tvboxspy@gmail.com&gt;
Cc: Steven Toth &lt;stoth@kernellabs.com&gt;
Cc: "André Weidemann" &lt;Andre.Weidemann@web.de&gt;
Cc: Martin Wilks &lt;m.wilks@technisat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jose Alberto Reguero &lt;jareguero@telefonica.net&gt;
Cc: David Henningsson &lt;david.henningsson@canonical.com&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Jesper Juhl &lt;jj@chaosbits.net&gt;
Cc: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
Cc: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Cc: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Cc: Anssi Hannula &lt;anssi.hannula@iki.fi&gt;
Cc: Rafi Rubin &lt;rafi@seas.upenn.edu&gt;
Cc: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: Paul Bender &lt;pebender@gmail.com&gt;
Cc: Devin Heitmueller &lt;dheitmueller@kernellabs.com&gt;
Cc: "Márcio A Alves" &lt;froooozen@gmail.com&gt;
Cc: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Chris Rankin &lt;rankincj@yahoo.com&gt;
Cc: Lee Jones &lt;lee.jones@canonical.com&gt;
Cc: Andy Walls &lt;awalls@md.metrocast.net&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Mike Frysinger &lt;vapier@gentoo.org&gt;
Cc: Dean Anderson &lt;linux-dev@sensoray.com&gt;
Cc: Pete Eberlein &lt;pete@sensoray.com&gt;
Cc: Arvydas Sidorenko &lt;asido4@gmail.com&gt;
Cc: Andrea Anacleto &lt;andreaanacleto@libero.it&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: don't parse scancodes until intf configured</title>
<updated>2011-09-21T17:48:15+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-07-19T15:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6f6b90c9231ad6b18f7393e1b6c6cef9dc6aa77c'/>
<id>6f6b90c9231ad6b18f7393e1b6c6cef9dc6aa77c</id>
<content type='text'>
The imon devices have either 1 or 2 usb interfaces on them, each wired
up to its own urb callback. The interface 0 urb callback is wired up
before the imon context's rc_dev pointer is filled in, which is
necessary for imon 0xffdc device auto-detection to work properly, but we
need to make sure we don't actually run the callback routines until
we've entirely filled in the necessary bits for each given interface,
lest we wind up oopsing. Technically, any imon device could have hit
this, but the issue is exacerbated on the 0xffdc devices, which send a
constant stream of interrupts, even when they have no valid key data.

CC: Andy Walls &lt;awalls@md.metrocast.net&gt;
CC: Chris W &lt;lkml@psychogeeks.com&gt;
Reported-by: Chris W &lt;lkml@psychogeeks.com&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The imon devices have either 1 or 2 usb interfaces on them, each wired
up to its own urb callback. The interface 0 urb callback is wired up
before the imon context's rc_dev pointer is filled in, which is
necessary for imon 0xffdc device auto-detection to work properly, but we
need to make sure we don't actually run the callback routines until
we've entirely filled in the necessary bits for each given interface,
lest we wind up oopsing. Technically, any imon device could have hit
this, but the issue is exacerbated on the 0xffdc devices, which send a
constant stream of interrupts, even when they have no valid key data.

CC: Andy Walls &lt;awalls@md.metrocast.net&gt;
CC: Chris W &lt;lkml@psychogeeks.com&gt;
Reported-by: Chris W &lt;lkml@psychogeeks.com&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: rate-limit send_packet spew</title>
<updated>2011-08-06T13:46:45+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-07-14T17:20:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=47a09b082f70502195ee800bb0cd6f311b125c8f'/>
<id>47a09b082f70502195ee800bb0cd6f311b125c8f</id>
<content type='text'>
There are folks with flaky imon hardware out there that doesn't always
respond to requests to write to their displays for some reason, which
can flood logs quickly when something like lcdproc is trying to
constantly update the display, so lets rate-limit all that error spew.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are folks with flaky imon hardware out there that doesn't always
respond to requests to write to their displays for some reason, which
can flood logs quickly when something like lcdproc is trying to
constantly update the display, so lets rate-limit all that error spew.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: allow either proto on unknown 0xffdc</title>
<updated>2011-07-01T19:34:01+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-06-20T03:07:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=372b4249243d1e7c12a0f2b67e7badc608fcff45'/>
<id>372b4249243d1e7c12a0f2b67e7badc608fcff45</id>
<content type='text'>
While 0xffdc devices have their IR protocol hard-coded into the firmware
of the device, we have no known way of telling what it is if we don't
have the device's config byte already in the driver. Unknown devices
default to the imon native protocol, but might actually be rc6, so we
should set the driver up such that the user can load the rc6 keytable
from userspace and still have a working device ahead of its config byte
being added to the driver.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While 0xffdc devices have their IR protocol hard-coded into the firmware
of the device, we have no known way of telling what it is if we don't
have the device's config byte already in the driver. Unknown devices
default to the imon native protocol, but might actually be rc6, so we
should set the driver up such that the user can load the rc6 keytable
from userspace and still have a working device ahead of its config byte
being added to the driver.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: auto-config ffdc 7e device</title>
<updated>2011-07-01T19:33:38+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-06-20T03:04:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=842071c9ea021a42256386cb0cbe3735af33c4db'/>
<id>842071c9ea021a42256386cb0cbe3735af33c4db</id>
<content type='text'>
Another device with the 0xffdc device id, this one with 0x7e in the
config byte. Its an iMON VFD + RC6 IR, in a CoolerMaster 260 case.

Reported-by: Filip Streibl &lt;filip@streibl.cz&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Another device with the 0xffdc device id, this one with 0x7e in the
config byte. Its an iMON VFD + RC6 IR, in a CoolerMaster 260 case.

Reported-by: Filip Streibl &lt;filip@streibl.cz&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: fix initial panel key repeat suppression</title>
<updated>2011-06-11T12:04:24+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-06-04T17:14:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94215ccd99eb6e3c8a035c06984630bd7479d963'/>
<id>94215ccd99eb6e3c8a035c06984630bd7479d963</id>
<content type='text'>
As pointed out on the lirc list by Andreas Dick, initial panel key
repeat suppression wasn't working, as we had no timevals accumulated
until after the first repeat. Also add a missing locking call.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As pointed out on the lirc list by Andreas Dick, initial panel key
repeat suppression wasn't working, as we had no timevals accumulated
until after the first repeat. Also add a missing locking call.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: support for 0x46 0xffdc imon vfd</title>
<updated>2011-06-11T12:04:16+00:00</updated>
<author>
<name>Jarod Wilson</name>
<email>jarod@redhat.com</email>
</author>
<published>2011-06-04T17:00:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=443b391900469f2c5ec5a354ce305000096a94b7'/>
<id>443b391900469f2c5ec5a354ce305000096a94b7</id>
<content type='text'>
Courtesy of information from Andreas Dick on the lirc list.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Courtesy of information from Andreas Dick on the lirc list.

Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] imon: Correct call to input_free_device</title>
<updated>2011-05-20T19:34:24+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2011-05-20T18:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aeb35ebc5f54bcdd7163f5282a3f39bc48c75cae'/>
<id>aeb35ebc5f54bcdd7163f5282a3f39bc48c75cae</id>
<content type='text'>
ictx-&gt;touch is intialied in imon_init_intf1, to the result of calling the
function that contains this code.  Thus, in this code, input_free_device
should be called on touch itself.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@r exists@
local idexpression struct input_dev * x;
expression ra,rr;
position p1,p2;
@@

x = input_allocate_device@p1(...)
...  when != x = rr
    when != input_free_device(x,...)
    when != if (...) { ... input_free_device(x,...) ...}
if(...) { ... when != x = ra
    when forall
    when != input_free_device(x,...)
\(return &lt;+...x...+&gt;; \| return@p2...; \) }

@script:python@
p1 &lt;&lt; r.p1;
p2 &lt;&lt; r.p2;
@@

cocci.print_main("input_allocate_device",p1)
cocci.print_secs("input_free_device",p2)
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ictx-&gt;touch is intialied in imon_init_intf1, to the result of calling the
function that contains this code.  Thus, in this code, input_free_device
should be called on touch itself.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@r exists@
local idexpression struct input_dev * x;
expression ra,rr;
position p1,p2;
@@

x = input_allocate_device@p1(...)
...  when != x = rr
    when != input_free_device(x,...)
    when != if (...) { ... input_free_device(x,...) ...}
if(...) { ... when != x = ra
    when forall
    when != input_free_device(x,...)
\(return &lt;+...x...+&gt;; \| return@p2...; \) }

@script:python@
p1 &lt;&lt; r.p1;
p2 &lt;&lt; r.p2;
@@

cocci.print_main("input_allocate_device",p1)
cocci.print_secs("input_free_device",p2)
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
