upstream: [media] v4l2-device: check if already unregistered
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 12 Jun 2013 09:04:04 +0000 (06:04 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:56:06 +0000 (11:56 +0900)
commit09ff168d9a7e1daaba38a3471e9634d1dc6ad6a6
tree49b711e62138dc5b643d399b791ee18935d2efd3
parent85891426b875abbfc6a0fb0dfabbe71fb9b9d7e3
upstream: [media] v4l2-device: check if already unregistered

It was possible to unregister an already unregistered v4l2_device struct.
Add a check whether that already happened and just return if that was
the case.
Also refuse to register a v4l2_device if both the dev and name fields are
empty. A warning was already produced in that case, but since the name field
is now used to detect whether or not the v4l2_device was already unregistered
this particular combination should be rejected.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-device.c