Skip to content

Commit

Permalink
ALSA: dice: allow notifications during initialization
Browse files Browse the repository at this point in the history
Reorganize the initialization order so that the driver can receive
notifications earlier.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
  • Loading branch information
Clemens Ladisch committed Oct 20, 2013
1 parent a030199 commit 5ea4018
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sound/firewire/dice.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,6 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
dice->unit = unit;
init_waitqueue_head(&dice->hwdep_wait);

err = dice_read_params(dice);
if (err < 0)
goto err_mutex;

dice->notification_handler.length = 4;
dice->notification_handler.address_callback = dice_notification;
dice->notification_handler.callback_data = dice;
Expand All @@ -936,20 +932,24 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
if (err < 0)
goto err_mutex;

err = fw_iso_resources_init(&dice->resources, unit);
err = dice_owner_set(dice);
if (err < 0)
goto err_notification_handler;

err = dice_read_params(dice);
if (err < 0)
goto err_owner;

err = fw_iso_resources_init(&dice->resources, unit);
if (err < 0)
goto err_owner;
dice->resources.channels_mask = 0x00000000ffffffffuLL;

err = amdtp_out_stream_init(&dice->stream, unit,
CIP_BLOCKING | CIP_HI_DUALWIRE);
if (err < 0)
goto err_resources;

err = dice_owner_set(dice);
if (err < 0)
goto err_stream;

card->private_free = dice_card_free;

dice_card_strings(dice);
Expand Down Expand Up @@ -983,10 +983,10 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)

return 0;

err_stream:
amdtp_out_stream_destroy(&dice->stream);
err_resources:
fw_iso_resources_destroy(&dice->resources);
err_owner:
dice_owner_clear(dice);
err_notification_handler:
fw_core_remove_address_handler(&dice->notification_handler);
err_mutex:
Expand Down

0 comments on commit 5ea4018

Please sign in to comment.