aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2013-06-09 12:15:00 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2013-06-09 12:15:00 -0400
commit94a87157cde95d38b9cdf1116e4f0fd93f6d25df (patch)
tree42cb11cbab50860a66d3e4191c43a85cf42bd77f /drivers/staging
parent317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff)
firewire: introduce fw_driver.probe and .remove methods
FireWire upper layer drivers are converted from generic struct driver.probe() and .remove() to bus-specific struct fw_driver.probe() and .remove(). The new .probe() adds a const struct ieee1394_device_id *id argument, indicating the entry in the driver's device identifiers table which matched the fw_unit to be probed. This new argument is used by the snd-firewire-speakers driver to look up device-specific parameters and methods. There is at least one other FireWire audio driver currently in development in which this will be useful too. The new .remove() drops the unused error return code. Although all in-tree drivers are being converted to the new methods, support for the old methods is left in place in this commit. This allows public developer trees to merge this commit and then move to the new fw_driver methods. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Clemens Ladisch <clemens@ladisch.de> (for sound/firewire/) Cc: Peter Hurley <peter@hurleysoftware.com> (for drivers/staging/fwserial/)
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fwserial/fwserial.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index e5818a1c2262..a8399f9c9392 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2438,9 +2438,9 @@ free_ports:
2438 * last peer for a given fw_card triggering the destruction of the same 2438 * last peer for a given fw_card triggering the destruction of the same
2439 * fw_serial for the same fw_card. 2439 * fw_serial for the same fw_card.
2440 */ 2440 */
2441static int fwserial_probe(struct device *dev) 2441static int fwserial_probe(struct fw_unit *unit,
2442 const struct ieee1394_device_id *id)
2442{ 2443{
2443 struct fw_unit *unit = fw_unit(dev);
2444 struct fw_serial *serial; 2444 struct fw_serial *serial;
2445 int err; 2445 int err;
2446 2446
@@ -2462,9 +2462,9 @@ static int fwserial_probe(struct device *dev)
2462 * specific fw_card). If this is the last peer being removed, then trigger 2462 * specific fw_card). If this is the last peer being removed, then trigger
2463 * the destruction of the underlying TTYs. 2463 * the destruction of the underlying TTYs.
2464 */ 2464 */
2465static int fwserial_remove(struct device *dev) 2465static void fwserial_remove(struct fw_unit *unit)
2466{ 2466{
2467 struct fwtty_peer *peer = dev_get_drvdata(dev); 2467 struct fwtty_peer *peer = dev_get_drvdata(&unit->device);
2468 struct fw_serial *serial = peer->serial; 2468 struct fw_serial *serial = peer->serial;
2469 int i; 2469 int i;
2470 2470
@@ -2484,8 +2484,6 @@ static int fwserial_remove(struct device *dev)
2484 kref_put(&serial->kref, fwserial_destroy); 2484 kref_put(&serial->kref, fwserial_destroy);
2485 } 2485 }
2486 mutex_unlock(&fwserial_list_mutex); 2486 mutex_unlock(&fwserial_list_mutex);
2487
2488 return 0;
2489} 2487}
2490 2488
2491/** 2489/**
@@ -2530,10 +2528,10 @@ static struct fw_driver fwserial_driver = {
2530 .owner = THIS_MODULE, 2528 .owner = THIS_MODULE,
2531 .name = KBUILD_MODNAME, 2529 .name = KBUILD_MODNAME,
2532 .bus = &fw_bus_type, 2530 .bus = &fw_bus_type,
2533 .probe = fwserial_probe,
2534 .remove = fwserial_remove,
2535 }, 2531 },
2532 .probe = fwserial_probe,
2536 .update = fwserial_update, 2533 .update = fwserial_update,
2534 .remove = fwserial_remove,
2537 .id_table = fwserial_id_table, 2535 .id_table = fwserial_id_table,
2538}; 2536};
2539 2537