Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' into for-next

+25 -28
+5 -5
sound/core/init.c
··· 178 178 return -ENOMEM; 179 179 180 180 err = snd_card_init(card, parent, idx, xid, module, extra_size); 181 - if (err < 0) { 182 - kfree(card); 183 - return err; 184 - } 181 + if (err < 0) 182 + return err; /* card is freed by error handler */ 185 183 186 184 *card_ret = card; 187 185 return 0; ··· 231 233 card->managed = true; 232 234 err = snd_card_init(card, parent, idx, xid, module, extra_size); 233 235 if (err < 0) { 234 - devres_free(card); 236 + devres_free(card); /* in managed mode, we need to free manually */ 235 237 return err; 236 238 } 237 239 ··· 295 297 mutex_unlock(&snd_card_mutex); 296 298 dev_err(parent, "cannot find the slot for index %d (range 0-%i), error: %d\n", 297 299 idx, snd_ecards_limit - 1, err); 300 + if (!card->managed) 301 + kfree(card); /* manually free here, as no destructor called */ 298 302 return err; 299 303 } 300 304 set_bit(idx, snd_cards_lock); /* lock it */
+14 -9
sound/usb/endpoint.c
··· 758 758 * The endpoint needs to be closed via snd_usb_endpoint_close() later. 759 759 * 760 760 * Note that this function doesn't configure the endpoint. The substream 761 - * needs to set it up later via snd_usb_endpoint_set_params() and 762 - * snd_usb_endpoint_prepare(). 761 + * needs to set it up later via snd_usb_endpoint_configure(). 763 762 */ 764 763 struct snd_usb_endpoint * 765 764 snd_usb_endpoint_open(struct snd_usb_audio *chip, ··· 1292 1293 /* 1293 1294 * snd_usb_endpoint_set_params: configure an snd_usb_endpoint 1294 1295 * 1295 - * It's called either from hw_params callback. 1296 1296 * Determine the number of URBs to be used on this endpoint. 1297 1297 * An endpoint must be configured before it can be started. 1298 1298 * An endpoint that is already running can not be reconfigured. 1299 1299 */ 1300 - int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, 1301 - struct snd_usb_endpoint *ep) 1300 + static int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, 1301 + struct snd_usb_endpoint *ep) 1302 1302 { 1303 1303 const struct audioformat *fmt = ep->cur_audiofmt; 1304 1304 int err; ··· 1380 1382 } 1381 1383 1382 1384 /* 1383 - * snd_usb_endpoint_prepare: Prepare the endpoint 1385 + * snd_usb_endpoint_configure: Configure the endpoint 1384 1386 * 1385 1387 * This function sets up the EP to be fully usable state. 1386 - * It's called either from prepare callback. 1388 + * It's called either from hw_params or prepare callback. 1387 1389 * The function checks need_setup flag, and performs nothing unless needed, 1388 1390 * so it's safe to call this multiple times. 1389 1391 * 1390 1392 * This returns zero if unchanged, 1 if the configuration has changed, 1391 1393 * or a negative error code. 1392 1394 */ 1393 - int snd_usb_endpoint_prepare(struct snd_usb_audio *chip, 1394 - struct snd_usb_endpoint *ep) 1395 + int snd_usb_endpoint_configure(struct snd_usb_audio *chip, 1396 + struct snd_usb_endpoint *ep) 1395 1397 { 1396 1398 bool iface_first; 1397 1399 int err = 0; ··· 1412 1414 if (err < 0) 1413 1415 goto unlock; 1414 1416 } 1417 + err = snd_usb_endpoint_set_params(chip, ep); 1418 + if (err < 0) 1419 + goto unlock; 1415 1420 goto done; 1416 1421 } 1417 1422 ··· 1439 1438 goto unlock; 1440 1439 1441 1440 err = init_sample_rate(chip, ep); 1441 + if (err < 0) 1442 + goto unlock; 1443 + 1444 + err = snd_usb_endpoint_set_params(chip, ep); 1442 1445 if (err < 0) 1443 1446 goto unlock; 1444 1447
+2 -4
sound/usb/endpoint.h
··· 17 17 bool is_sync_ep); 18 18 void snd_usb_endpoint_close(struct snd_usb_audio *chip, 19 19 struct snd_usb_endpoint *ep); 20 - int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, 21 - struct snd_usb_endpoint *ep); 22 - int snd_usb_endpoint_prepare(struct snd_usb_audio *chip, 23 - struct snd_usb_endpoint *ep); 20 + int snd_usb_endpoint_configure(struct snd_usb_audio *chip, 21 + struct snd_usb_endpoint *ep); 24 22 int snd_usb_endpoint_get_clock_rate(struct snd_usb_audio *chip, int clock); 25 23 26 24 bool snd_usb_endpoint_compatible(struct snd_usb_audio *chip,
+4 -10
sound/usb/pcm.c
··· 443 443 if (stop_endpoints(subs, false)) 444 444 sync_pending_stops(subs); 445 445 if (subs->sync_endpoint) { 446 - err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); 446 + err = snd_usb_endpoint_configure(chip, subs->sync_endpoint); 447 447 if (err < 0) 448 448 return err; 449 449 } 450 - err = snd_usb_endpoint_prepare(chip, subs->data_endpoint); 450 + err = snd_usb_endpoint_configure(chip, subs->data_endpoint); 451 451 if (err < 0) 452 452 return err; 453 453 snd_usb_set_format_quirk(subs, subs->cur_audiofmt); 454 454 } else { 455 455 if (subs->sync_endpoint) { 456 - err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); 456 + err = snd_usb_endpoint_configure(chip, subs->sync_endpoint); 457 457 if (err < 0) 458 458 return err; 459 459 } ··· 551 551 subs->cur_audiofmt = fmt; 552 552 mutex_unlock(&chip->mutex); 553 553 554 - if (subs->sync_endpoint) { 555 - ret = snd_usb_endpoint_set_params(chip, subs->sync_endpoint); 556 - if (ret < 0) 557 - goto unlock; 558 - } 559 - 560 - ret = snd_usb_endpoint_set_params(chip, subs->data_endpoint); 554 + ret = configure_endpoints(chip, subs); 561 555 562 556 unlock: 563 557 if (ret < 0)