Changeset 717 for GPL/trunk/alsa-kernel/isa
- Timestamp:
- Aug 7, 2022, 6:11:12 PM (3 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
alsa-kernel/isa/sb/sb_common.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-next merged: 710-716
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/isa/sb/sb_common.c
r703 r717 169 169 } 170 170 171 static int snd_sbdsp_free(struct snd_sb *chip)172 {173 release_and_free_resource(chip->res_port);174 if (chip->irq >= 0)175 free_irq(chip->irq, (void *) chip);176 #ifdef CONFIG_ISA177 if (chip->dma8 >= 0) {178 disable_dma(chip->dma8);179 free_dma(chip->dma8);180 }181 if (chip->dma16 >= 0 && chip->dma16 != chip->dma8) {182 disable_dma(chip->dma16);183 free_dma(chip->dma16);184 }185 #endif186 kfree(chip);187 return 0;188 }189 190 static int snd_sbdsp_dev_free(struct snd_device *device)191 {192 struct snd_sb *chip = device->device_data;193 return snd_sbdsp_free(chip);194 }195 196 171 int snd_sbdsp_create(struct snd_card *card, 197 172 unsigned long port, … … 205 180 struct snd_sb *chip; 206 181 int err; 207 static const struct snd_device_ops ops = {208 .dev_free = snd_sbdsp_dev_free,209 };210 182 211 183 if (snd_BUG_ON(!r_chip)) 212 184 return -EINVAL; 213 185 *r_chip = NULL; 214 chip = kzalloc(sizeof(*chip), GFP_KERNEL);215 if ( chip == NULL)186 chip = devm_kzalloc(card->dev, sizeof(*chip), GFP_KERNEL); 187 if (!chip) 216 188 return -ENOMEM; 217 189 spin_lock_init(&chip->reg_lock); … … 224 196 chip->port = port; 225 197 226 if ( request_irq(irq, irq_handler,227 (hardware == SB_HW_ALS4000 ||228 hardware == SB_HW_CS5530) ?229 IRQF_SHARED : 0,230 "SoundBlaster", (void *) chip)) {198 if (devm_request_irq(card->dev, irq, irq_handler, 199 (hardware == SB_HW_ALS4000 || 200 hardware == SB_HW_CS5530) ? 201 IRQF_SHARED : 0, 202 "SoundBlaster", (void *) chip)) { 231 203 snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq); 232 snd_sbdsp_free(chip);233 204 return -EBUSY; 234 205 } … … 239 210 goto __skip_allocation; 240 211 241 chip->res_port = request_region(port, 16, "SoundBlaster"); 212 chip->res_port = devm_request_region(card->dev, port, 16, 213 "SoundBlaster"); 242 214 if (!chip->res_port) { 243 215 snd_printk(KERN_ERR "sb: can't grab port 0x%lx\n", port); 244 snd_sbdsp_free(chip);245 216 return -EBUSY; 246 217 } 247 218 248 219 #ifdef CONFIG_ISA 249 if (dma8 >= 0 && request_dma(dma8, "SoundBlaster - 8bit")) { 220 if (dma8 >= 0 && snd_devm_request_dma(card->dev, dma8, 221 "SoundBlaster - 8bit")) { 250 222 snd_printk(KERN_ERR "sb: can't grab DMA8 %d\n", dma8); 251 snd_sbdsp_free(chip);252 223 return -EBUSY; 253 224 } … … 257 228 /* no duplex */ 258 229 dma16 = -1; 259 } else if (request_dma(dma16, "SoundBlaster - 16bit")) { 230 } else if (snd_devm_request_dma(card->dev, dma16, 231 "SoundBlaster - 16bit")) { 260 232 snd_printk(KERN_ERR "sb: can't grab DMA16 %d\n", dma16); 261 snd_sbdsp_free(chip);262 233 return -EBUSY; 263 234 } … … 270 241 chip->hardware = hardware; 271 242 err = snd_sbdsp_probe(chip); 272 if (err < 0) { 273 snd_sbdsp_free(chip); 243 if (err < 0) 274 244 return err; 275 }276 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);277 if (err < 0) {278 snd_sbdsp_free(chip);279 return err;280 }281 245 *r_chip = chip; 282 246 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
