summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fwserial/fwserial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/fwserial/fwserial.c')
-rw-r--r--drivers/staging/fwserial/fwserial.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 41a49c8194e5..1993b03a6f2d 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
/*
* FireWire Serial driver
*
* Copyright (C) 2012 Peter Hurley <peter@hurleysoftware.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -217,13 +208,6 @@ static void fwtty_log_tx_error(struct fwtty_port *port, int rcode)
}
}
-static void fwtty_txn_constructor(void *this)
-{
- struct fwtty_transaction *txn = this;
-
- init_timer(&txn->fw_txn.split_timeout_timer);
-}
-
static void fwtty_common_callback(struct fw_card *card, int rcode,
void *payload, size_t len, void *cb_data)
{
@@ -1806,9 +1790,9 @@ static void fwserial_release_port(struct fwtty_port *port, bool reset)
(*port->fwcon_ops->notify)(FWCON_NOTIFY_DETACH, port->con_data);
}
-static void fwserial_plug_timeout(unsigned long data)
+static void fwserial_plug_timeout(struct timer_list *t)
{
- struct fwtty_peer *peer = (struct fwtty_peer *)data;
+ struct fwtty_peer *peer = from_timer(peer, t, timer);
struct fwtty_port *port;
spin_lock_bh(&peer->lock);
@@ -1860,7 +1844,6 @@ static int fwserial_connect_peer(struct fwtty_peer *peer)
fill_plug_req(pkt, peer->port);
- setup_timer(&peer->timer, fwserial_plug_timeout, (unsigned long)peer);
mod_timer(&peer->timer, jiffies + VIRT_CABLE_PLUG_TIMEOUT);
spin_unlock_bh(&peer->lock);
@@ -2098,7 +2081,7 @@ static int fwserial_add_peer(struct fw_serial *serial, struct fw_unit *unit)
spin_lock_init(&peer->lock);
peer->port = NULL;
- init_timer(&peer->timer);
+ timer_setup(&peer->timer, fwserial_plug_timeout, 0);
INIT_WORK(&peer->work, fwserial_peer_workfn);
INIT_DELAYED_WORK(&peer->connect, fwserial_auto_connect);
@@ -2863,7 +2846,7 @@ static int __init fwserial_init(void)
fwtty_txn_cache = kmem_cache_create("fwtty_txn_cache",
sizeof(struct fwtty_transaction),
- 0, 0, fwtty_txn_constructor);
+ 0, 0, NULL);
if (!fwtty_txn_cache) {
err = -ENOMEM;
goto unregister_loop;