diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-09-04 16:17:38 -0400 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2013-10-20 16:07:57 -0400 |
commit | 1b70485f135a39d5f2d8c392a16817456fa3a5cd (patch) | |
tree | cf1b9b833619374c3169c368890652d53594b43d /sound/firewire/scs1x.c | |
parent | a644a9473f7f9519e2fe519136959dd0e671572a (diff) |
ALSA: firewire: extend snd_fw_transaction()
Add a flag to snd_fw_transaction() to allow it to abort when a bus reset
happens. This removes most of the duplicated error handling loops that
were required around calls to the low-level fw_run_transaction().
Also add a flag to suppress error messages; errors are expected when we
attempt to clean up after the device was unplugged.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/firewire/scs1x.c')
-rw-r--r-- | sound/firewire/scs1x.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/firewire/scs1x.c b/sound/firewire/scs1x.c index 505fc8123199..858023cf4298 100644 --- a/sound/firewire/scs1x.c +++ b/sound/firewire/scs1x.c | |||
@@ -369,7 +369,7 @@ static int scs_init_hss_address(struct scs *scs) | |||
369 | data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) | | 369 | data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) | |
370 | scs->hss_handler.offset); | 370 | scs->hss_handler.offset); |
371 | err = snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST, | 371 | err = snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST, |
372 | HSS1394_ADDRESS, &data, 8); | 372 | HSS1394_ADDRESS, &data, 8, 0); |
373 | if (err < 0) | 373 | if (err < 0) |
374 | dev_err(&scs->unit->device, "HSS1394 communication failed\n"); | 374 | dev_err(&scs->unit->device, "HSS1394 communication failed\n"); |
375 | 375 | ||
@@ -455,12 +455,16 @@ err_card: | |||
455 | static void scs_update(struct fw_unit *unit) | 455 | static void scs_update(struct fw_unit *unit) |
456 | { | 456 | { |
457 | struct scs *scs = dev_get_drvdata(&unit->device); | 457 | struct scs *scs = dev_get_drvdata(&unit->device); |
458 | int generation; | ||
458 | __be64 data; | 459 | __be64 data; |
459 | 460 | ||
460 | data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) | | 461 | data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) | |
461 | scs->hss_handler.offset); | 462 | scs->hss_handler.offset); |
463 | generation = fw_parent_device(unit)->generation; | ||
464 | smp_rmb(); /* node_id vs. generation */ | ||
462 | snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST, | 465 | snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST, |
463 | HSS1394_ADDRESS, &data, 8); | 466 | HSS1394_ADDRESS, &data, 8, |
467 | FW_FIXED_GENERATION | generation); | ||
464 | } | 468 | } |
465 | 469 | ||
466 | static void scs_remove(struct fw_unit *unit) | 470 | static void scs_remove(struct fw_unit *unit) |