From 5f976f58917eafbd8f725b9b7c0efcf6937e0e83 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 12 May 2017 10:02:08 +0200 Subject: 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 --- sound/pci/vx222/vx222.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/pci/vx222/vx222.c') diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index ecbaf47..5586184 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) { -- cgit v1.1