Commit 8a718752 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: v4l: async: Set owner for async sub-devices

Set the owner field of the async sub-devices by making
v4l2_async_register_subdev() a macro and obtaining THIS_MODULE that way.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent aa7b1488
...@@ -783,7 +783,7 @@ v4l2_async_connection_unique(struct v4l2_subdev *sd) ...@@ -783,7 +783,7 @@ v4l2_async_connection_unique(struct v4l2_subdev *sd)
} }
EXPORT_SYMBOL_GPL(v4l2_async_connection_unique); EXPORT_SYMBOL_GPL(v4l2_async_connection_unique);
int v4l2_async_register_subdev(struct v4l2_subdev *sd) int __v4l2_async_register_subdev(struct v4l2_subdev *sd, struct module *module)
{ {
struct v4l2_async_notifier *subdev_notifier; struct v4l2_async_notifier *subdev_notifier;
struct v4l2_async_notifier *notifier; struct v4l2_async_notifier *notifier;
...@@ -807,6 +807,8 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) ...@@ -807,6 +807,8 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
return -EINVAL; return -EINVAL;
} }
sd->owner = module;
mutex_lock(&list_lock); mutex_lock(&list_lock);
list_for_each_entry(notifier, &notifier_list, notifier_entry) { list_for_each_entry(notifier, &notifier_list, notifier_entry) {
...@@ -849,9 +851,11 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) ...@@ -849,9 +851,11 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
mutex_unlock(&list_lock); mutex_unlock(&list_lock);
sd->owner = NULL;
return ret; return ret;
} }
EXPORT_SYMBOL(v4l2_async_register_subdev); EXPORT_SYMBOL(__v4l2_async_register_subdev);
void v4l2_async_unregister_subdev(struct v4l2_subdev *sd) void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
{ {
......
...@@ -310,7 +310,9 @@ void v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier); ...@@ -310,7 +310,9 @@ void v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier);
* *
* @sd: pointer to &struct v4l2_subdev * @sd: pointer to &struct v4l2_subdev
*/ */
int v4l2_async_register_subdev(struct v4l2_subdev *sd); #define v4l2_async_register_subdev(sd) \
__v4l2_async_register_subdev(sd, THIS_MODULE)
int __v4l2_async_register_subdev(struct v4l2_subdev *sd, struct module *module);
/** /**
* v4l2_async_register_subdev_sensor - registers a sensor sub-device to the * v4l2_async_register_subdev_sensor - registers a sensor sub-device to the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment