aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/scs1x.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/scs1x.c')
-rw-r--r--sound/firewire/scs1x.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/sound/firewire/scs1x.c b/sound/firewire/scs1x.c
index b252c21b6d13..505fc8123199 100644
--- a/sound/firewire/scs1x.c
+++ b/sound/firewire/scs1x.c
@@ -384,9 +384,8 @@ static void scs_card_free(struct snd_card *card)
kfree(scs->buffer);
}
-static int scs_probe(struct device *unit_dev)
+static int scs_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
{
- struct fw_unit *unit = fw_unit(unit_dev);
struct fw_device *fw_dev = fw_parent_device(unit);
struct snd_card *card;
struct scs *scs;
@@ -395,7 +394,7 @@ static int scs_probe(struct device *unit_dev)
err = snd_card_create(-16, NULL, THIS_MODULE, sizeof(*scs), &card);
if (err < 0)
return err;
- snd_card_set_dev(card, unit_dev);
+ snd_card_set_dev(card, &unit->device);
scs = card->private_data;
scs->card = card;
@@ -442,7 +441,7 @@ static int scs_probe(struct device *unit_dev)
if (err < 0)
goto err_card;
- dev_set_drvdata(unit_dev, scs);
+ dev_set_drvdata(&unit->device, scs);
return 0;
@@ -453,9 +452,20 @@ err_card:
return err;
}
-static int scs_remove(struct device *dev)
+static void scs_update(struct fw_unit *unit)
{
- struct scs *scs = dev_get_drvdata(dev);
+ struct scs *scs = dev_get_drvdata(&unit->device);
+ __be64 data;
+
+ data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) |
+ scs->hss_handler.offset);
+ snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST,
+ HSS1394_ADDRESS, &data, 8);
+}
+
+static void scs_remove(struct fw_unit *unit)
+{
+ struct scs *scs = dev_get_drvdata(&unit->device);
snd_card_disconnect(scs->card);
@@ -467,19 +477,6 @@ static int scs_remove(struct device *dev)
tasklet_kill(&scs->tasklet);
snd_card_free_when_closed(scs->card);
-
- return 0;
-}
-
-static void scs_update(struct fw_unit *unit)
-{
- struct scs *scs = dev_get_drvdata(&unit->device);
- __be64 data;
-
- data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) |
- scs->hss_handler.offset);
- snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST,
- HSS1394_ADDRESS, &data, 8);
}
static const struct ieee1394_device_id scs_id_table[] = {
@@ -508,10 +505,10 @@ static struct fw_driver scs_driver = {
.owner = THIS_MODULE,
.name = KBUILD_MODNAME,
.bus = &fw_bus_type,
- .probe = scs_probe,
- .remove = scs_remove,
},
+ .probe = scs_probe,
.update = scs_update,
+ .remove = scs_remove,
.id_table = scs_id_table,
};