summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/au0828/au0828-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-11 18:35:07 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-16 11:43:13 +0100
commit67873d4e751e400149df7ab61ba04cbb4cc0d449 (patch)
treed6496ef23cdc30420b72866ce7ffe81dc9093489 /drivers/media/usb/au0828/au0828-core.c
parent[media] allow overriding the driver name (diff)
downloadlinux-67873d4e751e400149df7ab61ba04cbb4cc0d449.tar.xz
linux-67873d4e751e400149df7ab61ba04cbb4cc0d449.zip
[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/au0828/au0828-core.c')
-rw-r--r--drivers/media/usb/au0828/au0828-core.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index f23da7e7984b..7cafe4dd5fd1 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -191,23 +191,12 @@ static int au0828_media_device_init(struct au0828_dev *dev,
#ifdef CONFIG_MEDIA_CONTROLLER
struct media_device *mdev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
- if (!mdev)
- return -ENOMEM;
-
- mdev->dev = &udev->dev;
-
if (!dev->board.name)
- strlcpy(mdev->model, "unknown au0828", sizeof(mdev->model));
+ mdev = v4l2_mc_usb_media_device_init(udev, "unknown au0828");
else
- strlcpy(mdev->model, dev->board.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, dev->board.name);
+ if (!mdev)
+ return -ENOMEM;
dev->media_dev = mdev;
#endif