OSDN Git Service

[media] media: lirc_dev: sanitize locking
authorDavid Härdeman <david@hardeman.nu>
Fri, 30 Jun 2017 08:41:57 +0000 (05:41 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 4 Oct 2017 17:02:27 +0000 (14:02 -0300)
commit3381b779a736f4908a64b603ce339ab067e01de7
treee10bd4644efa6b3b47eee0f097c87ea3dde515a4
parent3bce5572364899970cbe908d98c51d1bc743b2f8
[media] media: lirc_dev: sanitize locking

Use the irctl mutex for all device operations and only use lirc_dev_lock
to protect the irctls array. Also, make sure that the device is alive
early in each fops function before doing anything else.

Since this patch touches nearly every line where the irctl mutex is
taken/released, it also renames the mutex at the same time (the name
irctl_lock will be misleading once struct irctl goes away in later
patches).

[mchehab@s-opensource.com: fix a merge conflict]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/rc/lirc_dev.c