aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-31 09:54:05 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-31 14:09:04 -0400
commit405ddbfa68177b6169d09bc2308a39196a8eb64a (patch)
tree357ee733300f8ba6ea40abc452b8903ea7525f89
parentc89178f57a19300b2056f58167e183e966a4836d (diff)
[media] Revert "[media] media: au0828 change to use Managed Media Controller API"
Extending the lifetime of the media_device struct is not handled well by the core, as it will erase some data from the struct, when media_device_cleanup() is called after unregistering it. While we have a fixup patch for it already, the usage of those new functions are needed only when we share data with other drivers. So, better to revert the changes. This reverts commit 182dde7c5d4c ("[media] media: au0828 change to use Managed Media Controller API") Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/au0828/au0828-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index a40958ad8341..cc22b32776ad 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -144,6 +144,7 @@ static void au0828_unregister_media_device(struct au0828_dev *dev)
144 144
145 media_device_unregister(dev->media_dev); 145 media_device_unregister(dev->media_dev);
146 media_device_cleanup(dev->media_dev); 146 media_device_cleanup(dev->media_dev);
147 kfree(dev->media_dev);
147 dev->media_dev = NULL; 148 dev->media_dev = NULL;
148 } 149 }
149#endif 150#endif
@@ -197,7 +198,7 @@ static int au0828_media_device_init(struct au0828_dev *dev,
197#ifdef CONFIG_MEDIA_CONTROLLER 198#ifdef CONFIG_MEDIA_CONTROLLER
198 struct media_device *mdev; 199 struct media_device *mdev;
199 200
200 mdev = media_device_get_devres(&udev->dev); 201 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
201 if (!mdev) 202 if (!mdev)
202 return -ENOMEM; 203 return -ENOMEM;
203 204