You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
743e18377c
commit
85de721c46
@@ -232,7 +232,8 @@ static const struct file_operations media_devnode_fops = {
|
||||
* the media_devnode structure is *not* called, so the caller is responsible for
|
||||
* freeing any data.
|
||||
*/
|
||||
int __must_check media_devnode_register(struct media_devnode *mdev)
|
||||
int __must_check media_devnode_register(struct media_devnode *mdev,
|
||||
struct module *owner)
|
||||
{
|
||||
int minor;
|
||||
int ret;
|
||||
@@ -253,7 +254,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev)
|
||||
|
||||
/* Part 2: Initialize and register the character device */
|
||||
cdev_init(&mdev->cdev, &media_devnode_fops);
|
||||
mdev->cdev.owner = mdev->fops->owner;
|
||||
mdev->cdev.owner = owner;
|
||||
|
||||
ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1);
|
||||
if (ret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user