]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] remove redundent assignment to the ac97 device structure
authorNicolas Pitre <nico@cam.org>
Fri, 16 Sep 2005 16:49:22 +0000 (18:49 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 7 Oct 2005 12:45:44 +0000 (14:45 +0200)
AC97 Codec
Don't use dev.platform_data to store a reference to the containing
ac97_t structure.  Such assignment is redundent since we can deduce the
ac97_t structure location from the contained device structure.  This
sets platform_data free for other purposes.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/ac97_codec.h
sound/pci/ac97/ac97_codec.c

index 2857cf0472df02116ff7e1c82ddc4a8906752752..d11f34832a972597dfa71890dde819dc24d8ad03 100644 (file)
@@ -527,6 +527,8 @@ struct _snd_ac97 {
        struct device dev;
 };
 
+#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev)
+
 /* conditions */
 static inline int ac97_is_audio(ac97_t * ac97)
 {
index f221eba5c32f8baaca11219a54b42a3dca08f199..41fc290149ed19a49dcd40b84161c7191657563b 100644 (file)
@@ -1828,7 +1828,6 @@ static int snd_ac97_dev_register(snd_device_t *device)
 
        ac97->dev.bus = &ac97_bus_type;
        ac97->dev.parent = ac97->bus->card->dev;
-       ac97->dev.platform_data = ac97;
        ac97->dev.release = ac97_device_release;
        snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "card%d-%d", ac97->bus->card->number, ac97->num);
        if ((err = device_register(&ac97->dev)) < 0) {