diff options
| author | Sakari Ailus <[email protected]> | 2024-03-13 13:57:50 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2024-04-26 10:31:19 +0000 |
| commit | 8a718752f5c339137c5b05e54f116cd26d5a4143 (patch) | |
| tree | 9d4efc4c609fc4f8b2429c380e245d8e823acfe8 /drivers/media/v4l2-core/v4l2-async.c | |
| parent | media: v4l: Set sub-device's owner field to the caller's module (diff) | |
| download | kernel-8a718752f5c339137c5b05e54f116cd26d5a4143.tar.gz kernel-8a718752f5c339137c5b05e54f116cd26d5a4143.zip | |
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: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-async.c')
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-async.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index b28f6811a5f4..3a22da443a22 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -783,7 +783,7 @@ v4l2_async_connection_unique(struct v4l2_subdev *sd) } 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 *notifier; @@ -807,6 +807,8 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) return -EINVAL; } + sd->owner = module; + mutex_lock(&list_lock); list_for_each_entry(notifier, ¬ifier_list, notifier_entry) { @@ -849,9 +851,11 @@ err_unbind: mutex_unlock(&list_lock); + sd->owner = NULL; + return ret; } -EXPORT_SYMBOL(v4l2_async_register_subdev); +EXPORT_SYMBOL(__v4l2_async_register_subdev); void v4l2_async_unregister_subdev(struct v4l2_subdev *sd) { |
