linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] sound/usb/media: use core routine to initialize media_device
@ 2016-03-16 13:00 Mauro Carvalho Chehab
  2016-03-16 13:00 ` [PATCH 2/2] [media] media-device: make topology_version u64 Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-16 13:00 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Jaroslav Kysela,
	Takashi Iwai, Shuah Khan, alsa-devel

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 sound/usb/media.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/usb/media.c b/sound/usb/media.c
index 93a50d01490c..44a5de91f748 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) {
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] [media] media-device: make topology_version u64
  2016-03-16 13:00 [PATCH 1/2] sound/usb/media: use core routine to initialize media_device Mauro Carvalho Chehab
@ 2016-03-16 13:00 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-16 13:00 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab

The uAPI defines it with 64 bits. Let's change the Kernel
implementation too.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 include/media/media-device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/media-device.h b/include/media/media-device.h
index 9166bff8068e..4a475604d992 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -358,7 +358,7 @@ struct media_device {
 	u32 hw_revision;
 	u32 driver_version;
 
-	u32 topology_version;
+	u64 topology_version;
 
 	u32 id;
 	struct ida entity_internal_idx;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-16 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 13:00 [PATCH 1/2] sound/usb/media: use core routine to initialize media_device Mauro Carvalho Chehab
2016-03-16 13:00 ` [PATCH 2/2] [media] media-device: make topology_version u64 Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).