From 72bc8c4378f82307ff09f0959011fef2c818146d Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Wed, 3 Oct 2018 08:21:53 +0900 Subject: ALSA: oxfw: use managed-resource to maintain model-specific data ALSA oxfw driver allocates memory objects for data specific to some models. These objects are used to maintain functionalities specific to the models for ALSA rawMIDI/control interfaces. They can be released as managed-resource of 'struct snd_card.card_dev'. This commit uses managed-resource of the sound card device for this purpose. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/oxfw/oxfw-scs1x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sound/firewire/oxfw/oxfw-scs1x.c') diff --git a/sound/firewire/oxfw/oxfw-scs1x.c b/sound/firewire/oxfw/oxfw-scs1x.c index f33497cdc706..9d9545880a28 100644 --- a/sound/firewire/oxfw/oxfw-scs1x.c +++ b/sound/firewire/oxfw/oxfw-scs1x.c @@ -372,8 +372,9 @@ int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw) struct fw_scs1x *scs; int err; - scs = kzalloc(sizeof(struct fw_scs1x), GFP_KERNEL); - if (scs == NULL) + scs = devm_kzalloc(&oxfw->card->card_dev, sizeof(struct fw_scs1x), + GFP_KERNEL); + if (!scs) return -ENOMEM; scs->fw_dev = fw_parent_device(oxfw->unit); oxfw->spec = scs; -- cgit v1.2.3-55-g7522