diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-22 12:10:49 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-23 07:19:39 -0300 |
commit | 6cf5dad17e913fce1ccb0c38e199eff15b0f03cc (patch) | |
tree | b039fae16d8290e8d54e4e614a1a0fb3dfd7e34a /drivers/media/pci | |
parent | 41b44e35ba9b34e50a65c05ecf7642c07bd3e8aa (diff) | |
download | talos-op-linux-6cf5dad17e913fce1ccb0c38e199eff15b0f03cc.tar.gz talos-op-linux-6cf5dad17e913fce1ccb0c38e199eff15b0f03cc.zip |
[media] media_device: move allocation out of media_device_*_init
Right now, media_device_pci_init and media_device_usb_init does
media_device allocation internaly. That preents its usage when
the media_device struct is embedded on some other structure.
Move memory allocation outside it, to make it more generic.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index 8ae65bb320a3..2e77a5a80119 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -1043,11 +1043,12 @@ static int saa7134_initdev(struct pci_dev *pci_dev, sprintf(dev->name, "saa%x[%d]", pci_dev->device, dev->nr); #ifdef CONFIG_MEDIA_CONTROLLER - dev->media_dev = media_device_pci_init(pci_dev, dev->name); + dev->media_dev = kzalloc(sizeof(*dev->media_dev), GFP_KERNEL); if (!dev->media_dev) { err = -ENOMEM; goto fail0; } + media_device_pci_init(dev->media_dev, pci_dev, dev->name); dev->v4l2_dev.mdev = dev->media_dev; #endif |