media: ipu3-cio2: Unregister device nodes first, then release resources
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 10 Oct 2018 08:01:05 +0000 (04:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Dec 2018 08:16:09 +0000 (09:16 +0100)
commitf84263bfd8015da1a48a9f7ab4aaacb1b105086c
tree20976f2a3c502501dfa7de9d80217e04fdf73223
parent61880fb56851ca60b0520bc15378eef24e147f96
media: ipu3-cio2: Unregister device nodes first, then release resources

[ Upstream commit 32388d6ef7cffc7d8291b67f8dfa26acd45217fd ]

While there are issues related to object lifetime management, unregister
the media device first, followed immediately by other device nodes when
the driver is being unbound. Only then the resources needed by the driver
may be released. This is slightly safer.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/intel/ipu3/ipu3-cio2.c