summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/siano
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-22 16:10:49 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-23 11:19:39 +0100
commit6cf5dad17e913fce1ccb0c38e199eff15b0f03cc (patch)
treeb039fae16d8290e8d54e4e614a1a0fb3dfd7e34a /drivers/media/usb/siano
parent[media] media-device: move PCI/USB helper functions from v4l2-mc (diff)
downloadlinux-6cf5dad17e913fce1ccb0c38e199eff15b0f03cc.tar.xz
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/usb/siano')
-rw-r--r--drivers/media/usb/siano/smsusb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 4a0def1e1528..c2e25876e93b 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -367,10 +367,12 @@ static void *siano_media_device_register(struct smsusb_device_t *dev,
struct sms_board *board = sms_get_board(board_id);
int ret;
- mdev = media_device_usb_init(udev, board->name);
+ mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
if (!mdev)
return NULL;
+ media_device_usb_init(mdev, udev, board->name);
+
ret = media_device_register(mdev);
if (ret) {
media_device_cleanup(mdev);