]> asedeno.scripts.mit.edu Git - linux.git/commit
media: v4l2-async: Get fwnode reference when putting it to the notifier's list
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 4 Apr 2019 23:43:29 +0000 (19:43 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 25 Jul 2019 12:01:43 +0000 (08:01 -0400)
commit016413d967061fc2eb6798a487b3022bef7698a6
treec3d23c44eb7ed8ea9de1cec43d39634493ec30fd
parent6a76404b13ba7101216967dc447b77cf69e56adf
media: v4l2-async: Get fwnode reference when putting it to the notifier's list

The v4l2_async_notifier_add_fwnode_subdev() did not take a reference of
the added fwnode, relying on the caller to handle that instead, in essence
putting the fwnode to be added if there was an error.

As the reference is eventually released during the notifier cleanup, this
is not intuitive nor logical. Improve this by always getting a reference
when the function succeeds, and the caller releasing the reference when it
does not *itself* need it anymore.

Luckily, perhaps, there were just a handful of callers using the function.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/am437x/am437x-vpfe.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/qcom/camss/camss.c
drivers/media/platform/xilinx/xilinx-vipp.c
drivers/media/v4l2-core/v4l2-async.c
drivers/media/v4l2-core/v4l2-fwnode.c
include/media/v4l2-async.h