summaryrefslogtreecommitdiff
path: root/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-11 20:35:07 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-16 13:43:13 +0300
commit67873d4e751e400149df7ab61ba04cbb4cc0d449 (patch)
treed6496ef23cdc30420b72866ce7ffe81dc9093489 /drivers/media/usb/dvb-usb/dvb-usb-dvb.c
parentbb07bd6b6851120ac9b25bb315d62d9782d2c345 (diff)
downloadlinux-67873d4e751e400149df7ab61ba04cbb4cc0d449.tar.xz
[media] use v4l2_mc_usb_media_device_init() on most USB devices
Except for the usbuvc driver (with has an embedded media_device struct on it), the other drivers have a pointer to media_device. On those drivers, replace their own implementation for the core one. That warrants that those subdev drivers will fill the media_device info the same way. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb/dvb-usb-dvb.c')
-rw-r--r--drivers/media/usb/dvb-usb/dvb-usb-dvb.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index 71de19ba0e01..513b0c14e4f0 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -7,6 +7,7 @@
* linux-dvb API.
*/
#include "dvb-usb-common.h"
+#include <media/v4l2-mc.h>
/* does the complete input transfer handling */
static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
@@ -102,19 +103,7 @@ static int dvb_usb_media_device_init(struct dvb_usb_adapter *adap)
struct dvb_usb_device *d = adap->dev;
struct usb_device *udev = d->udev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
- if (!mdev)
- return -ENOMEM;
-
- mdev->dev = &udev->dev;
- strlcpy(mdev->model, d->desc->name, sizeof(mdev->model));
- if (udev->serial)
- strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
- strcpy(mdev->bus_info, udev->devpath);
- mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
- mdev->driver_version = LINUX_VERSION_CODE;
-
- media_device_init(mdev);
+ mdev = v4l2_mc_usb_media_device_init(udev, d->desc->name);
dvb_register_media_controller(&adap->dvb_adap, mdev);