This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] sound/usb/media: use core routine to initialize media_device
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Wed Mar 16 09:40:29 2016 -0300

The media core has now a routine to initialize media_device
for USB devices. Use it, instead of doing its own logic,
as it warrants that all USB drivers will behave the same. It
also warrants that the device will get the same data, no matter
if it was initialized initially via snd-usb-audio or via
some other driver, like au0828.

Takashi Iwai informally acked with this patch.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 sound/usb/media.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=95302656782b6629f371965eaa730e013ce03e98
diff --git a/sound/usb/media.c b/sound/usb/media.c
index f78955fd0d6e..736c47f92ad1 100644
--- a/sound/usb/media.c
+++ b/sound/usb/media.c
@@ -263,19 +263,11 @@ int media_snd_device_create(struct snd_usb_audio *chip,
        mdev = media_device_get_devres(&usbdev->dev);
        if (!mdev)
                return -ENOMEM;
-       if (!mdev->dev) {
-               /* register media device */
-               mdev->dev = &usbdev->dev;
-               if (usbdev->product)
-                       strlcpy(mdev->model, usbdev->product,
-                               sizeof(mdev->model));
-               if (usbdev->serial)
-                       strlcpy(mdev->serial, usbdev->serial,
-                               sizeof(mdev->serial));
-               strcpy(mdev->bus_info, usbdev->devpath);
-               mdev->hw_revision = le16_to_cpu(usbdev->descriptor.bcdDevice);
-               media_device_init(mdev);
-       }
+
+       /* Initialize media device */
+       if (!mdev->dev)
+               media_device_usb_init(mdev, usbdev, NULL);
+
        if (!media_devnode_is_registered(&mdev->devnode)) {
                ret = media_device_register(mdev);
                if (ret) {

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to