From 85de721c46ba8ad9b283b2b3e307c9a3e8425042 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 12 Dec 2013 12:38:17 -0300 Subject: [media] media: Use a better owner for the media device mdev->fops->owner is actually the owner of the very same module which implements media_device_register(), so it can't be unloaded anyway. Instead, use THIS_MODULE through a macro as does video_register_device(). Signed-off-by: Sakari Ailus Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- include/media/media-device.h | 4 +++- include/media/media-devnode.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include/media') diff --git a/include/media/media-device.h b/include/media/media-device.h index 12155a9596c4..6e6db78f1ee2 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h @@ -87,7 +87,9 @@ struct media_device { /* media_devnode to media_device */ #define to_media_device(node) container_of(node, struct media_device, devnode) -int __must_check media_device_register(struct media_device *mdev); +int __must_check __media_device_register(struct media_device *mdev, + struct module *owner); +#define media_device_register(mdev) __media_device_register(mdev, THIS_MODULE) void media_device_unregister(struct media_device *mdev); int __must_check media_device_register_entity(struct media_device *mdev, diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h index 3446af279fca..0dc7060f9625 100644 --- a/include/media/media-devnode.h +++ b/include/media/media-devnode.h @@ -82,7 +82,8 @@ struct media_devnode { /* dev to media_devnode */ #define to_media_devnode(cd) container_of(cd, struct media_devnode, dev) -int __must_check media_devnode_register(struct media_devnode *mdev); +int __must_check media_devnode_register(struct media_devnode *mdev, + struct module *owner); void media_devnode_unregister(struct media_devnode *mdev); static inline struct media_devnode *media_devnode_data(struct file *filp) -- cgit v1.2.3