]> git.karo-electronics.de Git - karo-tx-linux.git/commit
media: staging: lirc_serial: Fix init/exit order
authorBen Hutchings <ben@decadent.org.uk>
Wed, 16 Nov 2011 04:49:41 +0000 (01:49 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Mar 2012 17:33:00 +0000 (10:33 -0700)
commit531036606ff0b72c5028134df255e4dd19ad6c20
treedc8287075629bf049f778fdb16ebc5be610eacd7
parenta55848dfa041f2a2d1e96243fcb242ebadabeb0a
media: staging: lirc_serial: Fix init/exit order

commit 9105b8b200410383d0854bbe237ee385d7d33ba6 upstream.

Currently the module init function registers a platform_device and
only then allocates its IRQ and I/O region.  This allows allocation to
race with the device's suspend() function.  Instead, allocate
resources in the platform driver's probe() function and free them in
the remove() function.

The module exit function removes the platform device before the
character device that provides access to it.  Change it to reverse the
order of initialisation.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lirc/lirc_serial.c