diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-05-12 10:02:08 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-05-15 11:21:05 +0200 |
commit | 5f976f58917eafbd8f725b9b7c0efcf6937e0e83 (patch) | |
tree | 90b92404da674fb2a6365a0a71e34914781f0b25 /sound/pci/vx222/vx222.c | |
parent | 6c1df232731f83621fd6d590aa1a2325ceefaed9 (diff) | |
download | linux-5f976f58917eafbd8f725b9b7c0efcf6937e0e83.tar.bz2 |
ALSA: vx222: Use container_of()
The vx222 driver is using the explicit cast from the parent class
pointer, but it'll be broken when the structure field randomization is
applied. Use container_of() in a modern manner, instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/vx222/vx222.c')
-rw-r--r-- | sound/pci/vx222/vx222.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index ecbaf473fc1e..55861849d7df 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c @@ -116,7 +116,7 @@ static struct snd_vx_hardware vx222_mic_hw = { */ static int snd_vx222_free(struct vx_core *chip) { - struct snd_vx222 *vx = (struct snd_vx222 *)chip; + struct snd_vx222 *vx = to_vx222(chip); if (chip->irq >= 0) free_irq(chip->irq, (void*)chip); @@ -158,7 +158,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci, pci_disable_device(pci); return -ENOMEM; } - vx = (struct snd_vx222 *)chip; + vx = to_vx222(chip); vx->pci = pci; if ((err = pci_request_regions(pci, CARD_NAME)) < 0) { |