aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia/vx/vxpocket.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-05-12 10:03:35 +0200
committerTakashi Iwai <tiwai@suse.de>2017-05-17 07:12:57 +0200
commit2e0de6ea956ff429cf11bd1a92d7444bc6000698 (patch)
tree7cd743dd2f71643a3d09ca565912d11f684246e9 /sound/pcmcia/vx/vxpocket.c
parentALSA: vx222: Use container_of() (diff)
downloadlinux-dev-2e0de6ea956ff429cf11bd1a92d7444bc6000698.tar.xz
linux-dev-2e0de6ea956ff429cf11bd1a92d7444bc6000698.zip
ALSA: vxpocket: Use container_of()
The vxpocket 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/pcmcia/vx/vxpocket.c')
-rw-r--r--sound/pcmcia/vx/vxpocket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index b16f42deed67..ca0d19e723fd 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -155,7 +155,7 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
}
chip->ibl.size = ibl;
- vxp = (struct snd_vxpocket *)chip;
+ vxp = to_vxpocket(chip);
vxp->p_dev = link;
link->priv = chip;
@@ -187,7 +187,7 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
{
int err;
struct snd_card *card = chip->card;
- struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
+ struct snd_vxpocket *vxp = to_vxpocket(chip);
snd_printdd(KERN_DEBUG "vxpocket assign resources: port = 0x%x, irq = %d\n", port, irq);
vxp->port = port;