]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/drivers/dummy.c
ALSA: emu10k1: Fix annotation and cast for the recent uapi header change
[linux.git] / sound / drivers / dummy.c
index cec682a7b88d4f6a195ee647a2a170c2719add78..02ac3f4e0c02f63d76b61ee3a9a28d139d8ea62d 100644 (file)
@@ -117,7 +117,7 @@ struct dummy_model {
 
 struct snd_dummy {
        struct snd_card *card;
-       struct dummy_model *model;
+       const struct dummy_model *model;
        struct snd_pcm *pcm;
        struct snd_pcm_hardware pcm_hw;
        spinlock_t mixer_lock;
@@ -144,13 +144,13 @@ static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
        return 0;
 }
 
-static struct dummy_model model_emu10k1 = {
+static const struct dummy_model model_emu10k1 = {
        .name = "emu10k1",
        .playback_constraints = emu10k1_playback_constraints,
        .buffer_bytes_max = 128 * 1024,
 };
 
-static struct dummy_model model_rme9652 = {
+static const struct dummy_model model_rme9652 = {
        .name = "rme9652",
        .buffer_bytes_max = 26 * 64 * 1024,
        .formats = SNDRV_PCM_FMTBIT_S32_LE,
@@ -160,7 +160,7 @@ static struct dummy_model model_rme9652 = {
        .periods_max = 2,
 };
 
-static struct dummy_model model_ice1712 = {
+static const struct dummy_model model_ice1712 = {
        .name = "ice1712",
        .buffer_bytes_max = 256 * 1024,
        .formats = SNDRV_PCM_FMTBIT_S32_LE,
@@ -170,7 +170,7 @@ static struct dummy_model model_ice1712 = {
        .periods_max = 1024,
 };
 
-static struct dummy_model model_uda1341 = {
+static const struct dummy_model model_uda1341 = {
        .name = "uda1341",
        .buffer_bytes_max = 16380,
        .formats = SNDRV_PCM_FMTBIT_S16_LE,
@@ -180,7 +180,7 @@ static struct dummy_model model_uda1341 = {
        .periods_max = 255,
 };
 
-static struct dummy_model model_ac97 = {
+static const struct dummy_model model_ac97 = {
        .name = "ac97",
        .formats = SNDRV_PCM_FMTBIT_S16_LE,
        .channels_min = 2,
@@ -190,7 +190,7 @@ static struct dummy_model model_ac97 = {
        .rate_max = 48000,
 };
 
-static struct dummy_model model_ca0106 = {
+static const struct dummy_model model_ca0106 = {
        .name = "ca0106",
        .formats = SNDRV_PCM_FMTBIT_S16_LE,
        .buffer_bytes_max = ((65536-64)*8),
@@ -204,7 +204,7 @@ static struct dummy_model model_ca0106 = {
        .rate_max = 192000,
 };
 
-static struct dummy_model *dummy_models[] = {
+static const struct dummy_model *dummy_models[] = {
        &model_emu10k1,
        &model_rme9652,
        &model_ice1712,
@@ -535,7 +535,7 @@ static int dummy_pcm_hw_params(struct snd_pcm_substream *substream,
 static int dummy_pcm_open(struct snd_pcm_substream *substream)
 {
        struct snd_dummy *dummy = snd_pcm_substream_chip(substream);
-       struct dummy_model *model = dummy->model;
+       const struct dummy_model *model = dummy->model;
        struct snd_pcm_runtime *runtime = substream->runtime;
        const struct dummy_timer_ops *ops;
        int err;
@@ -644,7 +644,7 @@ static struct page *dummy_pcm_page(struct snd_pcm_substream *substream,
        return virt_to_page(dummy_page[substream->stream]); /* the same page */
 }
 
-static struct snd_pcm_ops dummy_pcm_ops = {
+static const struct snd_pcm_ops dummy_pcm_ops = {
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
@@ -653,7 +653,7 @@ static struct snd_pcm_ops dummy_pcm_ops = {
        .pointer =      dummy_pcm_pointer,
 };
 
-static struct snd_pcm_ops dummy_pcm_ops_no_buf = {
+static const struct snd_pcm_ops dummy_pcm_ops_no_buf = {
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
@@ -670,7 +670,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
                              int substreams)
 {
        struct snd_pcm *pcm;
-       struct snd_pcm_ops *ops;
+       const struct snd_pcm_ops *ops;
        int err;
 
        err = snd_pcm_new(dummy->card, "Dummy PCM", device,
@@ -903,7 +903,7 @@ static void print_formats(struct snd_dummy *dummy,
 {
        int i;
 
-       for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
+       for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
                if (dummy->pcm_hw.formats & (1ULL << i))
                        snd_iprintf(buffer, " %s", snd_pcm_format_name(i));
        }
@@ -912,7 +912,7 @@ static void print_formats(struct snd_dummy *dummy,
 static void print_rates(struct snd_dummy *dummy,
                        struct snd_info_buffer *buffer)
 {
-       static int rates[] = {
+       static const int rates[] = {
                5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000,
                64000, 88200, 96000, 176400, 192000,
        };
@@ -944,7 +944,7 @@ struct dummy_hw_field {
        .offset = offsetof(struct snd_pcm_hardware, item), \
        .size = sizeof(dummy_pcm_hardware.item) }
 
-static struct dummy_hw_field fields[] = {
+static const struct dummy_hw_field fields[] = {
        FIELD_ENTRY(formats, "%#llx"),
        FIELD_ENTRY(rates, "%#x"),
        FIELD_ENTRY(rate_min, "%d"),
@@ -1022,7 +1022,7 @@ static int snd_dummy_probe(struct platform_device *devptr)
 {
        struct snd_card *card;
        struct snd_dummy *dummy;
-       struct dummy_model *m = NULL, **mdl;
+       const struct dummy_model *m = NULL, **mdl;
        int idx, err;
        int dev = devptr->id;