]> err.no Git - linux-2.6/blobdiff - sound/synth/emux/soundfont.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / sound / synth / emux / soundfont.c
index d0925ea50838d2b6497bc3dc399b037587b02d33..36d53bd317ede3f2d3cc1974c7003a7746789d14 100644 (file)
@@ -25,7 +25,6 @@
  * of doing things so that the old sfxload utility can be used.
  * Everything may change when there is an alsa way of doing things.
  */
-#include <sound/driver.h>
 #include <asm/uaccess.h>
 #include <linux/slab.h>
 #include <sound/core.h>
 
 /* Prototypes for static functions */
 
-static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client);
-static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name);
-static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name);
-static int close_patch(snd_sf_list_t *sflist);
-static int probe_data(snd_sf_list_t *sflist, int sample_id);
-static void set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp);
-static snd_sf_zone_t *sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf);
-static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
-static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf);
-static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
-static int load_map(snd_sf_list_t *sflist, const void __user *data, int count);
-static int load_info(snd_sf_list_t *sflist, const void __user *data, long count);
-static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr);
-static void init_voice_info(soundfont_voice_info_t *avp);
-static void init_voice_parm(soundfont_voice_parm_t *pp);
-static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp);
-static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id);
-static int load_data(snd_sf_list_t *sflist, const void __user *data, long count);
-static void rebuild_presets(snd_sf_list_t *sflist);
-static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur);
-static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp);
-static snd_sf_zone_t *search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key);
-static int search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level);
+static int open_patch(struct snd_sf_list *sflist, const char __user *data,
+                     int count, int client);
+static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name);
+static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);
+static int close_patch(struct snd_sf_list *sflist);
+static int probe_data(struct snd_sf_list *sflist, int sample_id);
+static void set_zone_counter(struct snd_sf_list *sflist,
+                            struct snd_soundfont *sf, struct snd_sf_zone *zp);
+static struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist,
+                                      struct snd_soundfont *sf);
+static void set_sample_counter(struct snd_sf_list *sflist,
+                              struct snd_soundfont *sf, struct snd_sf_sample *sp);
+static struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist,
+                                          struct snd_soundfont *sf);
+static void sf_sample_delete(struct snd_sf_list *sflist,
+                            struct snd_soundfont *sf, struct snd_sf_sample *sp);
+static int load_map(struct snd_sf_list *sflist, const void __user *data, int count);
+static int load_info(struct snd_sf_list *sflist, const void __user *data, long count);
+static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+                      int bank, int instr);
+static void init_voice_info(struct soundfont_voice_info *avp);
+static void init_voice_parm(struct soundfont_voice_parm *pp);
+static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
+                                       struct soundfont_voice_info *avp);
+static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
+static int load_data(struct snd_sf_list *sflist, const void __user *data, long count);
+static void rebuild_presets(struct snd_sf_list *sflist);
+static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur);
+static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp);
+static struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist,
+                                            int bank, int preset, int key);
+static int search_zones(struct snd_sf_list *sflist, int *notep, int vel,
+                       int preset, int bank, struct snd_sf_zone **table,
+                       int max_layers, int level);
 static int get_index(int bank, int instr, int key);
-static void snd_sf_init(snd_sf_list_t *sflist);
-static void snd_sf_clear(snd_sf_list_t *sflist);
+static void snd_sf_init(struct snd_sf_list *sflist);
+static void snd_sf_clear(struct snd_sf_list *sflist);
 
 /*
  * lock access to sflist
  */
 static void
-lock_preset(snd_sf_list_t *sflist)
+lock_preset(struct snd_sf_list *sflist)
 {
        unsigned long flags;
-       down(&sflist->presets_mutex);
+       mutex_lock(&sflist->presets_mutex);
        spin_lock_irqsave(&sflist->lock, flags);
        sflist->presets_locked = 1;
        spin_unlock_irqrestore(&sflist->lock, flags);
@@ -79,13 +89,13 @@ lock_preset(snd_sf_list_t *sflist)
  * remove lock
  */
 static void
-unlock_preset(snd_sf_list_t *sflist)
+unlock_preset(struct snd_sf_list *sflist)
 {
        unsigned long flags;
        spin_lock_irqsave(&sflist->lock, flags);
        sflist->presets_locked = 0;
        spin_unlock_irqrestore(&sflist->lock, flags);
-       up(&sflist->presets_mutex);
+       mutex_unlock(&sflist->presets_mutex);
 }
 
 
@@ -93,7 +103,7 @@ unlock_preset(snd_sf_list_t *sflist)
  * close the patch if the patch was opened by this client.
  */
 int
-snd_soundfont_close_check(snd_sf_list_t *sflist, int client)
+snd_soundfont_close_check(struct snd_sf_list *sflist, int client)
 {
        unsigned long flags;
        spin_lock_irqsave(&sflist->lock, flags);
@@ -115,9 +125,10 @@ snd_soundfont_close_check(snd_sf_list_t *sflist, int client)
  * it wants to do with it.
  */
 int
-snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client)
+snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
+                  long count, int client)
 {
-       soundfont_patch_info_t patch;
+       struct soundfont_patch_info patch;
        unsigned long flags;
        int  rc;
 
@@ -183,7 +194,7 @@ snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, i
                break;
        case SNDRV_SFNT_REMOVE_INFO:
                /* patch must be opened */
-               if (sflist->currsf) {
+               if (!sflist->currsf) {
                        snd_printk("soundfont: remove_info: patch not opened\n");
                        rc = -EINVAL;
                } else {
@@ -215,10 +226,11 @@ is_special_type(int type)
 
 /* open patch; create sf list */
 static int
-open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client)
+open_patch(struct snd_sf_list *sflist, const char __user *data,
+          int count, int client)
 {
-       soundfont_open_parm_t parm;
-       snd_soundfont_t *sf;
+       struct soundfont_open_parm parm;
+       struct snd_soundfont *sf;
        unsigned long flags;
 
        spin_lock_irqsave(&sflist->lock, flags);
@@ -251,10 +263,10 @@ open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client
 /*
  * Allocate a new soundfont structure.
  */
-static snd_soundfont_t *
-newsf(snd_sf_list_t *sflist, int type, char *name)
+static struct snd_soundfont *
+newsf(struct snd_sf_list *sflist, int type, char *name)
 {
-       snd_soundfont_t *sf;
+       struct snd_soundfont *sf;
 
        /* check the shared fonts */
        if (type & SNDRV_SFNT_PAT_SHARED) {
@@ -287,7 +299,7 @@ newsf(snd_sf_list_t *sflist, int type, char *name)
 
 /* check if the given name matches to the existing list */
 static int
-is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name)
+is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name)
 {
        return ((sf->type & SNDRV_SFNT_PAT_SHARED) &&
                (sf->type & 0x0f) == (type & 0x0f) &&
@@ -299,7 +311,7 @@ is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name)
  * Close the current patch.
  */
 static int
-close_patch(snd_sf_list_t *sflist)
+close_patch(struct snd_sf_list *sflist)
 {
        unsigned long flags;
 
@@ -316,7 +328,7 @@ close_patch(snd_sf_list_t *sflist)
 
 /* probe sample in the current list -- nothing to be loaded */
 static int
-probe_data(snd_sf_list_t *sflist, int sample_id)
+probe_data(struct snd_sf_list *sflist, int sample_id)
 {
        /* patch must be opened */
        if (sflist->currsf) {
@@ -331,7 +343,8 @@ probe_data(snd_sf_list_t *sflist, int sample_id)
  * increment zone counter
  */
 static void
-set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp)
+set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+                struct snd_sf_zone *zp)
 {
        zp->counter = sflist->zone_counter++;
        if (sf->type & SNDRV_SFNT_PAT_LOCKED)
@@ -341,10 +354,10 @@ set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp)
 /*
  * allocate a new zone record
  */
-static snd_sf_zone_t *
-sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
+static struct snd_sf_zone *
+sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
 {
-       snd_sf_zone_t *zp;
+       struct snd_sf_zone *zp;
 
        if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL)
                return NULL;
@@ -362,7 +375,8 @@ sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
  * increment sample couter
  */
 static void
-set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp)
+set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+                  struct snd_sf_sample *sp)
 {
        sp->counter = sflist->sample_counter++;
        if (sf->type & SNDRV_SFNT_PAT_LOCKED)
@@ -372,10 +386,10 @@ set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *
 /*
  * allocate a new sample list record
  */
-static snd_sf_sample_t *
-sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
+static struct snd_sf_sample *
+sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
 {
-       snd_sf_sample_t *sp;
+       struct snd_sf_sample *sp;
 
        if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL)
                return NULL;
@@ -392,7 +406,8 @@ sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
  * only the last allocated sample can be deleted.
  */
 static void
-sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp)
+sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+                struct snd_sf_sample *sp)
 {
        /* only last sample is accepted */
        if (sp == sf->samples) {
@@ -404,11 +419,11 @@ sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp
 
 /* load voice map */
 static int
-load_map(snd_sf_list_t *sflist, const void __user *data, int count)
+load_map(struct snd_sf_list *sflist, const void __user *data, int count)
 {
-       snd_sf_zone_t *zp, *prevp;
-       snd_soundfont_t *sf;
-       soundfont_voice_map_t map;
+       struct snd_sf_zone *zp, *prevp;
+       struct snd_soundfont *sf;
+       struct soundfont_voice_map map;
 
        /* get the link info */
        if (count < (int)sizeof(map))
@@ -469,9 +484,10 @@ load_map(snd_sf_list_t *sflist, const void __user *data, int count)
 
 /* remove the present instrument layers */
 static int
-remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr)
+remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+           int bank, int instr)
 {
-       snd_sf_zone_t *prev, *next, *p;
+       struct snd_sf_zone *prev, *next, *p;
        int removed = 0;
 
        prev = NULL;
@@ -500,11 +516,11 @@ remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr)
  * open soundfont.
  */
 static int
-load_info(snd_sf_list_t *sflist, const void __user *data, long count)
+load_info(struct snd_sf_list *sflist, const void __user *data, long count)
 {
-       snd_soundfont_t *sf;
-       snd_sf_zone_t *zone;
-       soundfont_voice_rec_hdr_t hdr;
+       struct snd_soundfont *sf;
+       struct snd_sf_zone *zone;
+       struct soundfont_voice_rec_hdr hdr;
        int i;
 
        /* patch must be opened */
@@ -529,7 +545,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
                return -EINVAL;
        }
 
-       if (count < (long)sizeof(soundfont_voice_info_t)*hdr.nvoices) {
+       if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
                printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n",
                       count, hdr.nvoices);
                return -EINVAL;
@@ -553,7 +569,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
        }
 
        for (i = 0; i < hdr.nvoices; i++) {
-               snd_sf_zone_t tmpzone;
+               struct snd_sf_zone tmpzone;
 
                /* copy awe_voice_info parameters */
                if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) {
@@ -590,7 +606,7 @@ load_info(snd_sf_list_t *sflist, const void __user *data, long count)
 
 /* initialize voice_info record */
 static void
-init_voice_info(soundfont_voice_info_t *avp)
+init_voice_info(struct soundfont_voice_info *avp)
 {
        memset(avp, 0, sizeof(*avp));
 
@@ -614,7 +630,7 @@ init_voice_info(soundfont_voice_info_t *avp)
  * Chorus and Reverb effects are zero.
  */
 static void
-init_voice_parm(soundfont_voice_parm_t *pp)
+init_voice_parm(struct soundfont_voice_parm *pp)
 {
        memset(pp, 0, sizeof(*pp));
 
@@ -635,10 +651,10 @@ init_voice_parm(soundfont_voice_parm_t *pp)
 }      
 
 /* search the specified sample */
-static snd_sf_sample_t *
-set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp)
+static struct snd_sf_sample *
+set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)
 {
-       snd_sf_sample_t *sample;
+       struct snd_sf_sample *sample;
 
        sample = find_sample(sf, avp->sample);
        if (sample == NULL)
@@ -661,10 +677,10 @@ set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp)
 }
 
 /* find the sample pointer with the given id in the soundfont */
-static snd_sf_sample_t *
-find_sample(snd_soundfont_t *sf, int sample_id)
+static struct snd_sf_sample *
+find_sample(struct snd_soundfont *sf, int sample_id)
 {
-       snd_sf_sample_t *p;
+       struct snd_sf_sample *p;
 
        if (sf == NULL)
                return NULL;
@@ -684,11 +700,11 @@ find_sample(snd_soundfont_t *sf, int sample_id)
  * routine.
  */
 static int
-load_data(snd_sf_list_t *sflist, const void __user *data, long count)
+load_data(struct snd_sf_list *sflist, const void __user *data, long count)
 {
-       snd_soundfont_t *sf;
-       soundfont_sample_info_t sample_info;
-       snd_sf_sample_t *sp;
+       struct snd_soundfont *sf;
+       struct soundfont_sample_info sample_info;
+       struct snd_sf_sample *sp;
        long off;
 
        /* patch must be opened */
@@ -793,6 +809,9 @@ snd_sf_linear_to_log(unsigned int amount, int offset, int ratio)
        return v;
 }
 
+EXPORT_SYMBOL(snd_sf_linear_to_log);
+
+
 #define OFFSET_MSEC            653117          /* base = 1000 */
 #define OFFSET_ABSCENT         851781          /* base = 8176 */
 #define OFFSET_SAMPLERATE      1011119         /* base = 44100 */
@@ -922,12 +941,13 @@ int snd_sf_vol_table[128] = {
 
 /* load GUS patch */
 static int
-load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client)
+load_guspatch(struct snd_sf_list *sflist, const char __user *data,
+             long count, int client)
 {
        struct patch_info patch;
-       snd_soundfont_t *sf;
-       snd_sf_zone_t *zone;
-       snd_sf_sample_t *smp;
+       struct snd_soundfont *sf;
+       struct snd_sf_zone *zone;
+       struct snd_sf_sample *smp;
        int note, sample_id;
        int rc;
 
@@ -992,7 +1012,8 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl
         */
        if (sflist->callback.sample_new) {
                rc = sflist->callback.sample_new
-                       (sflist->callback.private_data, smp, sflist->memhdr, data, count);
+                       (sflist->callback.private_data, smp, sflist->memhdr,
+                        data, count);
                if (rc < 0) {
                        sf_sample_delete(sflist, sf, smp);
                        return rc;
@@ -1095,7 +1116,7 @@ load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int cl
 
 /* load GUS patch */
 int
-snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
+snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
                            long count, int client)
 {
        int rc;
@@ -1114,10 +1135,10 @@ snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
  * bank/key combination).
  */
 static void
-rebuild_presets(snd_sf_list_t *sflist)
+rebuild_presets(struct snd_sf_list *sflist)
 {
-       snd_soundfont_t *sf;
-       snd_sf_zone_t *cur;
+       struct snd_soundfont *sf;
+       struct snd_sf_zone *cur;
 
        /* clear preset table */
        memset(sflist->presets, 0, sizeof(sflist->presets));
@@ -1142,15 +1163,15 @@ rebuild_presets(snd_sf_list_t *sflist)
  * add the given zone to preset table
  */
 static void
-add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur)
+add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur)
 {
-       snd_sf_zone_t *zone;
+       struct snd_sf_zone *zone;
        int index;
 
        zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low);
        if (zone && zone->v.sf_id != cur->v.sf_id) {
                /* different instrument was already defined */
-               snd_sf_zone_t *p;
+               struct snd_sf_zone *p;
                /* compare the allocated time */
                for (p = zone; p; p = p->next_zone) {
                        if (p->counter > cur->counter)
@@ -1174,10 +1195,10 @@ add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur)
  * delete the given zones from preset_table
  */
 static void
-delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp)
+delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp)
 {
        int index;
-       snd_sf_zone_t *p;
+       struct snd_sf_zone *p;
 
        if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0)
                return;
@@ -1200,10 +1221,10 @@ delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp)
  * This function returns the number of found zones.  0 if not found.
  */
 int
-snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
+snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
                          int preset, int bank,
                          int def_preset, int def_bank,
-                         snd_sf_zone_t **table, int max_layers)
+                         struct snd_sf_zone **table, int max_layers)
 {
        int nvoices;
        unsigned long flags;
@@ -1217,10 +1238,13 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
                spin_unlock_irqrestore(&sflist->lock, flags);
                return 0;
        }
-       nvoices = search_zones(sflist, notep, vel, preset, bank, table, max_layers, 0);
+       nvoices = search_zones(sflist, notep, vel, preset, bank,
+                              table, max_layers, 0);
        if (! nvoices) {
                if (preset != def_preset || bank != def_bank)
-                       nvoices = search_zones(sflist, notep, vel, def_preset, def_bank, table, max_layers, 0);
+                       nvoices = search_zones(sflist, notep, vel,
+                                              def_preset, def_bank,
+                                              table, max_layers, 0);
        }
        spin_unlock_irqrestore(&sflist->lock, flags);
        return nvoices;
@@ -1230,11 +1254,11 @@ snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
 /*
  * search the first matching zone
  */
-static snd_sf_zone_t *
-search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key)
+static struct snd_sf_zone *
+search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key)
 {
        int index;
-       snd_sf_zone_t *zp;
+       struct snd_sf_zone *zp;
 
        if ((index = get_index(bank, preset, key)) < 0)
                return NULL;
@@ -1250,9 +1274,11 @@ search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key)
  * search matching zones from sflist.  can be called recursively.
  */
 static int
-search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level)
+search_zones(struct snd_sf_list *sflist, int *notep, int vel,
+            int preset, int bank, struct snd_sf_zone **table,
+            int max_layers, int level)
 {
-       snd_sf_zone_t *zp;
+       struct snd_sf_zone *zp;
        int nvoices;
 
        zp = search_first_zone(sflist, bank, preset, *notep);
@@ -1310,7 +1336,7 @@ get_index(int bank, int instr, int key)
  * Initialise the sflist structure.
  */
 static void
-snd_sf_init(snd_sf_list_t *sflist)
+snd_sf_init(struct snd_sf_list *sflist)
 {
        memset(sflist->presets, 0, sizeof(sflist->presets));
 
@@ -1329,11 +1355,11 @@ snd_sf_init(snd_sf_list_t *sflist)
  * Release all list records
  */
 static void
-snd_sf_clear(snd_sf_list_t *sflist)
+snd_sf_clear(struct snd_sf_list *sflist)
 {
-       snd_soundfont_t *sf, *nextsf;
-       snd_sf_zone_t *zp, *nextzp;
-       snd_sf_sample_t *sp, *nextsp;
+       struct snd_soundfont *sf, *nextsf;
+       struct snd_sf_zone *zp, *nextzp;
+       struct snd_sf_sample *sp, *nextsp;
 
        for (sf = sflist->fonts; sf; sf = nextsf) {
                nextsf = sf->next;
@@ -1344,7 +1370,8 @@ snd_sf_clear(snd_sf_list_t *sflist)
                for (sp = sf->samples; sp; sp = nextsp) {
                        nextsp = sp->next;
                        if (sflist->callback.sample_free)
-                               sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr);
+                               sflist->callback.sample_free(sflist->callback.private_data,
+                                                            sp, sflist->memhdr);
                        kfree(sp);
                }
                kfree(sf);
@@ -1357,15 +1384,15 @@ snd_sf_clear(snd_sf_list_t *sflist)
 /*
  * Create a new sflist structure
  */
-snd_sf_list_t *
-snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr)
+struct snd_sf_list *
+snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr)
 {
-       snd_sf_list_t *sflist;
+       struct snd_sf_list *sflist;
 
        if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL)
                return NULL;
 
-       init_MUTEX(&sflist->presets_mutex);
+       mutex_init(&sflist->presets_mutex);
        spin_lock_init(&sflist->lock);
        sflist->memhdr = hdr;
 
@@ -1381,7 +1408,7 @@ snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr)
  * Free everything allocated off the sflist structure.
  */
 void
-snd_sf_free(snd_sf_list_t *sflist)
+snd_sf_free(struct snd_sf_list *sflist)
 {
        if (sflist == NULL)
                return;
@@ -1400,7 +1427,7 @@ snd_sf_free(snd_sf_list_t *sflist)
  * The soundcard should be silet before calling this function.
  */
 int
-snd_soundfont_remove_samples(snd_sf_list_t *sflist)
+snd_soundfont_remove_samples(struct snd_sf_list *sflist)
 {
        lock_preset(sflist);
        if (sflist->callback.sample_reset)
@@ -1416,11 +1443,11 @@ snd_soundfont_remove_samples(snd_sf_list_t *sflist)
  * The soundcard should be silent before calling this function.
  */
 int
-snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
+snd_soundfont_remove_unlocked(struct snd_sf_list *sflist)
 {
-       snd_soundfont_t *sf;
-       snd_sf_zone_t *zp, *nextzp;
-       snd_sf_sample_t *sp, *nextsp;
+       struct snd_soundfont *sf;
+       struct snd_sf_zone *zp, *nextzp;
+       struct snd_sf_sample *sp, *nextsp;
 
        lock_preset(sflist);
 
@@ -1446,7 +1473,8 @@ snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
                        sf->samples = nextsp;
                        sflist->mem_used -= sp->v.truesize;
                        if (sflist->callback.sample_free)
-                               sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr);
+                               sflist->callback.sample_free(sflist->callback.private_data,
+                                                            sp, sflist->memhdr);
                        kfree(sp);
                }
        }
@@ -1459,4 +1487,3 @@ snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
        unlock_preset(sflist);
        return 0;
 }
-