ALSA: ppc: Convert to snd_card_new() with a device pointer
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Jan 2014 13:38:59 +0000 (14:38 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 14 Feb 2014 07:14:06 +0000 (08:14 +0100)
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/aoa/core/alsa.c
sound/ppc/powermac.c
sound/ppc/snd_ps3.c

index 0fa3855b4790e30753b7b8ea4fb29644a6e8cd1f..9913bf222073537aea1ba8b7b9ac42c7cfa1d9e5 100644 (file)
@@ -23,13 +23,12 @@ int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
                /* cannot be EEXIST due to usage in aoa_fabric_register */
                return -EBUSY;
 
-       err = snd_card_create(index, name, mod, sizeof(struct aoa_card),
-                             &alsa_card);
+       err = snd_card_new(dev, index, name, mod, sizeof(struct aoa_card),
+                          &alsa_card);
        if (err < 0)
                return err;
        aoa_card = alsa_card->private_data;
        aoa_card->alsa_card = alsa_card;
-       alsa_card->dev = dev;
        strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver));
        strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname));
        strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname));
index 8abb521b4814b413a9423edf48bf2d7e41c08e2e..350a7c8f86dd4ef83b464cb994acdcba0b202727 100644 (file)
@@ -58,7 +58,7 @@ static int snd_pmac_probe(struct platform_device *devptr)
        char *name_ext;
        int err;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&devptr->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
@@ -122,8 +122,6 @@ static int snd_pmac_probe(struct platform_device *devptr)
        if (enable_beep)
                snd_pmac_attach_beep(chip);
 
-       snd_card_set_dev(card, &devptr->dev);
-
        if ((err = snd_card_register(card)) < 0)
                goto __error;
 
index ebb76f2d90d790175cbb35b93ffa1213f258a299..58f292a87f98fcc7eae969b4676b7feb487e4dfa 100644 (file)
@@ -984,7 +984,8 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
        }
 
        /* create card instance */
-       ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card);
+       ret = snd_card_new(&dev->core, index, id, THIS_MODULE,
+                          0, &the_card.card);
        if (ret < 0)
                goto clean_irq;
 
@@ -1052,7 +1053,6 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
        snd_ps3_init_avsetting(&the_card);
 
        /* register the card */
-       snd_card_set_dev(the_card.card, &dev->core);
        ret = snd_card_register(the_card.card);
        if (ret < 0)
                goto clean_dma_map;