diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2013-12-12 10:38:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-13 12:39:00 -0400 |
commit | 85de721c46ba8ad9b283b2b3e307c9a3e8425042 (patch) | |
tree | fd49693fa164755b123d15636a10d3ee3d949d85 /drivers/media/media-devnode.c | |
parent | 743e18377cae643f88ff62b4c2b87c45e4ecd024 (diff) |
[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 <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/media-devnode.c')
-rw-r--r-- | drivers/media/media-devnode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index fb0f0469fad7..7acd19c881de 100644 --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c | |||
@@ -232,7 +232,8 @@ static const struct file_operations media_devnode_fops = { | |||
232 | * the media_devnode structure is *not* called, so the caller is responsible for | 232 | * the media_devnode structure is *not* called, so the caller is responsible for |
233 | * freeing any data. | 233 | * freeing any data. |
234 | */ | 234 | */ |
235 | int __must_check media_devnode_register(struct media_devnode *mdev) | 235 | int __must_check media_devnode_register(struct media_devnode *mdev, |
236 | struct module *owner) | ||
236 | { | 237 | { |
237 | int minor; | 238 | int minor; |
238 | int ret; | 239 | int ret; |
@@ -253,7 +254,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev) | |||
253 | 254 | ||
254 | /* Part 2: Initialize and register the character device */ | 255 | /* Part 2: Initialize and register the character device */ |
255 | cdev_init(&mdev->cdev, &media_devnode_fops); | 256 | cdev_init(&mdev->cdev, &media_devnode_fops); |
256 | mdev->cdev.owner = mdev->fops->owner; | 257 | mdev->cdev.owner = owner; |
257 | 258 | ||
258 | ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1); | 259 | ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1); |
259 | if (ret < 0) { | 260 | if (ret < 0) { |