From a033954140ac43a8ce0eab469229a107cfee1c87 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 15 Jul 2021 09:59:11 +0200 Subject: ALSA: vx: Manage vx_core object with devres The firmware data are also released automatically. Link: https://lore.kernel.org/r/20210715075941.23332-50-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pcmcia/vx/vxpocket.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'sound/pcmcia/vx') diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 0dfb6a943b60..7a0f0e73ceb2 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -50,19 +50,6 @@ static void vxpocket_release(struct pcmcia_device *link) pcmcia_disable_device(link); } -/* - * destructor, called from snd_card_free_when_closed() - */ -static int snd_vxpocket_dev_free(struct snd_device *device) -{ - struct vx_core *chip = device->device_data; - - snd_vx_free_firmware(chip); - kfree(chip); - return 0; -} - - /* * Hardware information */ @@ -122,21 +109,12 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl, { struct vx_core *chip; struct snd_vxpocket *vxp; - static const struct snd_device_ops ops = { - .dev_free = snd_vxpocket_dev_free, - }; - int err; chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); if (!chip) return -ENOMEM; - err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); - if (err < 0) { - kfree(chip); - return err; - } chip->ibl.size = ibl; vxp = to_vxpocket(chip); -- cgit v1.2.3