]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'topic/memory-device-fixes-2' into for-next
authorTakashi Iwai <tiwai@suse.de>
Fri, 8 Feb 2019 13:12:15 +0000 (14:12 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 8 Feb 2019 13:12:15 +0000 (14:12 +0100)
Pull further device memory allocation cleanups (but no API change yet).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
1  2 
sound/pci/ad1889.c
sound/pci/lx6464es/lx6464es.c
sound/pci/rme9652/hdspm.c
sound/pci/via82xx_modem.c
sound/sparc/dbri.c

diff --combined sound/pci/ad1889.c
index f333bbf4187034f66b63ef04341256ff56892537,410fefe5ebdeb66234364e288ca2b9a2b7fdc804..fef07ae648e6bde9b781f5e977099a6a6d4d6162
@@@ -644,16 -644,11 +644,11 @@@ snd_ad1889_pcm_init(struct snd_ad1889 *
        chip->psubs = NULL;
        chip->csubs = NULL;
  
-       err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
                                                snd_dma_pci_data(chip->pci),
                                                BUFFER_BYTES_MAX / 2,
                                                BUFFER_BYTES_MAX);
  
-       if (err < 0) {
-               dev_err(chip->card->dev, "buffer allocation error: %d\n", err);
-               return err;
-       }
-       
        return 0;
  }
  
@@@ -741,8 -736,10 +736,8 @@@ snd_ad1889_proc_read(struct snd_info_en
  static void
  snd_ad1889_proc_init(struct snd_ad1889 *chip)
  {
 -      struct snd_info_entry *entry;
 -
 -      if (!snd_card_proc_new(chip->card, chip->card->driver, &entry))
 -              snd_info_set_text_ops(entry, chip, snd_ad1889_proc_read);
 +      snd_card_ro_proc_new(chip->card, chip->card->driver,
 +                           chip, snd_ad1889_proc_read);
  }
  
  static const struct ac97_quirk ac97_quirks[] = {
index 198ccf9b5eb389b093707d369e818542fe85bac8,52ea0da1fe73be544541bf2eae6286ae3ce44fd6..ae23a2dfbdea36fca8c30102a571ba2c9f11f5c5
@@@ -854,11 -854,9 +854,9 @@@ static int lx_pcm_create(struct lx6464e
        pcm->nonatomic = true;
        strcpy(pcm->name, card_name);
  
-       err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-                                                   snd_dma_pci_data(chip->pci),
-                                                   size, size);
-       if (err < 0)
-               return err;
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
+                                             snd_dma_pci_data(chip->pci),
+                                             size, size);
  
        chip->pcm = pcm;
        chip->capture_stream.is_capture = 1;
@@@ -948,7 -946,13 +946,7 @@@ static void lx_proc_levels_read(struct 
  
  static int lx_proc_create(struct snd_card *card, struct lx6464es *chip)
  {
 -      struct snd_info_entry *entry;
 -      int err = snd_card_proc_new(card, "levels", &entry);
 -      if (err < 0)
 -              return err;
 -
 -      snd_info_set_text_ops(entry, chip, lx_proc_levels_read);
 -      return 0;
 +      return snd_card_ro_proc_new(card, "levels", chip, lx_proc_levels_read);
  }
  
  
index d485dd8a7b724f878e541136cbda4e6fb95e5611,3e66df7b5d1f6f0428adf44b9626af41a3ffa877..1209cf0b05e00a677b66694e57c770a68d1b973b
@@@ -5287,35 -5287,44 +5287,35 @@@ static void snd_hdspm_proc_ports_out(st
  
  static void snd_hdspm_proc_init(struct hdspm *hdspm)
  {
 -      struct snd_info_entry *entry;
 +      void (*read)(struct snd_info_entry *, struct snd_info_buffer *) = NULL;
  
 -      if (!snd_card_proc_new(hdspm->card, "hdspm", &entry)) {
 -              switch (hdspm->io_type) {
 -              case AES32:
 -                      snd_info_set_text_ops(entry, hdspm,
 -                                      snd_hdspm_proc_read_aes32);
 -                      break;
 -              case MADI:
 -                      snd_info_set_text_ops(entry, hdspm,
 -                                      snd_hdspm_proc_read_madi);
 -                      break;
 -              case MADIface:
 -                      /* snd_info_set_text_ops(entry, hdspm,
 -                       snd_hdspm_proc_read_madiface); */
 -                      break;
 -              case RayDAT:
 -                      snd_info_set_text_ops(entry, hdspm,
 -                                      snd_hdspm_proc_read_raydat);
 -                      break;
 -              case AIO:
 -                      break;
 -              }
 -      }
 -
 -      if (!snd_card_proc_new(hdspm->card, "ports.in", &entry)) {
 -              snd_info_set_text_ops(entry, hdspm, snd_hdspm_proc_ports_in);
 +      switch (hdspm->io_type) {
 +      case AES32:
 +              read = snd_hdspm_proc_read_aes32;
 +              break;
 +      case MADI:
 +              read = snd_hdspm_proc_read_madi;
 +              break;
 +      case MADIface:
 +              /* read = snd_hdspm_proc_read_madiface; */
 +              break;
 +      case RayDAT:
 +              read = snd_hdspm_proc_read_raydat;
 +              break;
 +      case AIO:
 +              break;
        }
  
 -      if (!snd_card_proc_new(hdspm->card, "ports.out", &entry)) {
 -              snd_info_set_text_ops(entry, hdspm, snd_hdspm_proc_ports_out);
 -      }
 +      snd_card_ro_proc_new(hdspm->card, "hdspm", hdspm, read);
 +      snd_card_ro_proc_new(hdspm->card, "ports.in", hdspm,
 +                           snd_hdspm_proc_ports_in);
 +      snd_card_ro_proc_new(hdspm->card, "ports.out", hdspm,
 +                           snd_hdspm_proc_ports_out);
  
  #ifdef CONFIG_SND_DEBUG
        /* debug file to read all hdspm registers */
 -      if (!snd_card_proc_new(hdspm->card, "debug", &entry))
 -              snd_info_set_text_ops(entry, hdspm,
 -                              snd_hdspm_proc_read_debug);
 +      snd_card_ro_proc_new(hdspm->card, "debug", hdspm,
 +                           snd_hdspm_proc_read_debug);
  #endif
  }
  
@@@ -6402,7 -6411,6 +6402,6 @@@ static int snd_hdspm_create_hwdep(struc
   ------------------------------------------------------------*/
  static int snd_hdspm_preallocate_memory(struct hdspm *hdspm)
  {
-       int err;
        struct snd_pcm *pcm;
        size_t wanted;
  
  
        wanted = HDSPM_DMA_AREA_BYTES;
  
-       err =
-            snd_pcm_lib_preallocate_pages_for_all(pcm,
-                                                  SNDRV_DMA_TYPE_DEV_SG,
-                                                  snd_dma_pci_data(hdspm->pci),
-                                                  wanted,
-                                                  wanted);
-       if (err < 0) {
-               dev_dbg(hdspm->card->dev,
-                       "Could not preallocate %zd Bytes\n", wanted);
-               return err;
-       } else
-               dev_dbg(hdspm->card->dev,
-                       " Preallocated %zd Bytes\n", wanted);
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(hdspm->pci),
+                                             wanted, wanted);
+       dev_dbg(hdspm->card->dev, " Preallocated %zd Bytes\n", wanted);
        return 0;
  }
  
index 848bf9dbf8cd88ad80dc9aeb76a9c643ed93d3dd,3b3768acf7e1dc9f8c75182ebe929753a7e252f8..7e0bebce7b772270ca0dda702d73145da000430f
@@@ -865,11 -865,9 +865,9 @@@ static int snd_via686_pcm_new(struct vi
        init_viadev(chip, 0, VIA_REG_MO_STATUS, 0);
        init_viadev(chip, 1, VIA_REG_MI_STATUS, 1);
  
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024);
        return 0;
  }
  
@@@ -937,8 -935,10 +935,8 @@@ static void snd_via82xx_proc_read(struc
  
  static void snd_via82xx_proc_init(struct via82xx_modem *chip)
  {
 -      struct snd_info_entry *entry;
 -
 -      if (! snd_card_proc_new(chip->card, "via82xx", &entry))
 -              snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
 +      snd_card_ro_proc_new(chip->card, "via82xx", chip,
 +                           snd_via82xx_proc_read);
  }
  
  /*
diff --combined sound/sparc/dbri.c
index 682166202098df0646e9ce41cbd2dea4c5d67692,fc34c863b93cc5a4065d5e1def36e2dc2d677d0e..5e36d9bc971dea487a13dcb70309293e9293b32e
@@@ -2243,12 -2243,9 +2243,9 @@@ static int snd_dbri_pcm(struct snd_car
        pcm->info_flags = 0;
        strcpy(pcm->name, card->shortname);
  
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm,
-                       SNDRV_DMA_TYPE_CONTINUOUS,
-                       snd_dma_continuous_data(GFP_KERNEL),
-                       64 * 1024, 64 * 1024)) < 0)
-               return err;
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
+                                             snd_dma_continuous_data(GFP_KERNEL),
+                                             64 * 1024, 64 * 1024);
        return 0;
  }
  
@@@ -2510,10 -2507,16 +2507,10 @@@ static void dbri_debug_read(struct snd_
  static void snd_dbri_proc(struct snd_card *card)
  {
        struct snd_dbri *dbri = card->private_data;
 -      struct snd_info_entry *entry;
 -
 -      if (!snd_card_proc_new(card, "regs", &entry))
 -              snd_info_set_text_ops(entry, dbri, dbri_regs_read);
  
 +      snd_card_ro_proc_new(card, "regs", dbri, dbri_regs_read);
  #ifdef DBRI_DEBUG
 -      if (!snd_card_proc_new(card, "debug", &entry)) {
 -              snd_info_set_text_ops(entry, dbri, dbri_debug_read);
 -              entry->mode = S_IFREG | 0444;   /* Readable only. */
 -      }
 +      snd_card_ro_proc_new(card, "debug", dbri, dbri_debug_read);
  #endif
  }