]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/ac97/ac97_codec.c
sound: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / sound / pci / ac97 / ac97_codec.c
index 171559c19b3d2bb2ad26ea90f7858a7779ffea8c..bd510eceff1ff413422c0c5d004440e7a2fd44af 100644 (file)
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
 { 0x54584e20, 0xffffffff, "TLC320AD9xC",       NULL,           NULL },
 { 0x56494161, 0xffffffff, "VIA1612A",          NULL,           NULL }, // modified ICE1232 with S/PDIF
 { 0x56494170, 0xffffffff, "VIA1617A",          patch_vt1617a,  NULL }, // modified VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618",           NULL,           NULL },
+{ 0x56494182, 0xffffffff, "VIA1618",           patch_vt1618,   NULL },
 { 0x57454301, 0xffffffff, "W83971D",           NULL,           NULL },
 { 0x574d4c00, 0xffffffff, "WM9701,WM9701A",    NULL,           NULL },
 { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
@@ -1890,8 +1890,8 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
                .dev_free =     snd_ac97_bus_dev_free,
        };
 
-       snd_assert(card != NULL, return -EINVAL);
-       snd_assert(rbus != NULL, return -EINVAL);
+       if (snd_BUG_ON(!card))
+               return -EINVAL;
        bus = kzalloc(sizeof(*bus), GFP_KERNEL);
        if (bus == NULL)
                return -ENOMEM;
@@ -1906,7 +1906,8 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
                snd_ac97_bus_free(bus);
                return err;
        }
-       *rbus = bus;
+       if (rbus)
+               *rbus = bus;
        return 0;
 }
 
@@ -1926,9 +1927,9 @@ static int snd_ac97_dev_register(struct snd_device *device)
        ac97->dev.bus = &ac97_bus_type;
        ac97->dev.parent = ac97->bus->card->dev;
        ac97->dev.release = ac97_device_release;
-       snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s",
-                ac97->bus->card->number, ac97->num,
-                snd_ac97_get_short_name(ac97));
+       dev_set_name(&ac97->dev, "%d-%d:%s",
+                    ac97->bus->card->number, ac97->num,
+                    snd_ac97_get_short_name(ac97));
        if ((err = device_register(&ac97->dev)) < 0) {
                snd_printk(KERN_ERR "Can't register ac97 bus\n");
                ac97->dev.bus = NULL;
@@ -1991,10 +1992,14 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
                .dev_disconnect =       snd_ac97_dev_disconnect,
        };
 
-       snd_assert(rac97 != NULL, return -EINVAL);
-       *rac97 = NULL;
-       snd_assert(bus != NULL && template != NULL, return -EINVAL);
-       snd_assert(template->num < 4 && bus->codec[template->num] == NULL, return -EINVAL);
+       if (rac97)
+               *rac97 = NULL;
+       if (snd_BUG_ON(!bus || !template))
+               return -EINVAL;
+       if (snd_BUG_ON(template->num >= 4))
+               return -EINVAL;
+       if (bus->codec[template->num])
+               return -EBUSY;
 
        card = bus->card;
        ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL);