[SCSI] fcoe: Use setup_timer() and mod_timer()
[linux-block.git] / drivers / scsi / fcoe / libfcoe.c
index 5e68652985b2e2c73638c99520f5108daf3e2831..7887f2a7c2aae888ee0399e1145e3ef6c571d2f4 100644 (file)
@@ -387,7 +387,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
 
        WARN_ON((fr_len(fp) % sizeof(u32)) != 0);
 
-       fc = fcoe_softc(lp);
+       fc = lport_priv(lp);
        /*
         * if it is a flogi then we need to learn gw-addr
         * and my own fcid
@@ -768,7 +768,7 @@ static int fcoe_check_wait_queue(struct fc_lport *lp)
        struct sk_buff *skb;
        struct fcoe_softc *fc;
 
-       fc = fcoe_softc(lp);
+       fc = lport_priv(lp);
        spin_lock_bh(&fc->fcoe_pending_queue.lock);
 
        /*
@@ -805,7 +805,7 @@ static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
 {
        struct fcoe_softc *fc;
 
-       fc = fcoe_softc(lp);
+       fc = lport_priv(lp);
        spin_lock_bh(&fc->fcoe_pending_queue.lock);
        __skb_queue_head(&fc->fcoe_pending_queue, skb);
        spin_unlock_bh(&fc->fcoe_pending_queue.lock);
@@ -823,7 +823,7 @@ static void fcoe_insert_wait_queue(struct fc_lport *lp,
 {
        struct fcoe_softc *fc;
 
-       fc = fcoe_softc(lp);
+       fc = lport_priv(lp);
        spin_lock_bh(&fc->fcoe_pending_queue.lock);
        __skb_queue_tail(&fc->fcoe_pending_queue, skb);
        spin_unlock_bh(&fc->fcoe_pending_queue.lock);
@@ -949,8 +949,8 @@ static struct net_device *fcoe_if_to_netdev(const char *buffer)
  *
  * Returns: ptr to the struct module, NULL for failure
  */
-static struct module *fcoe_netdev_to_module_owner(
-       const struct net_device *netdev)
+static struct module *
+fcoe_netdev_to_module_owner(const struct net_device *netdev)
 {
        struct device *dev;
 
@@ -1113,7 +1113,7 @@ MODULE_PARM_DESC(destroy, "Destroy fcoe port");
  */
 int fcoe_link_ok(struct fc_lport *lp)
 {
-       struct fcoe_softc *fc = fcoe_softc(lp);
+       struct fcoe_softc *fc = lport_priv(lp);
        struct net_device *dev = fc->real_dev;
        struct ethtool_cmd ecmd = { ETHTOOL_GSET };
        int rc = 0;
@@ -1205,8 +1205,8 @@ EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);
  * Returns: ptr to Scsi_Host
  * TODO: to libfc?
  */
-static inline struct Scsi_Host *libfc_host_alloc(
-       struct scsi_host_template *sht, int priv_size)
+static inline struct Scsi_Host *
+libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
 {
        return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
 }
@@ -1285,8 +1285,8 @@ EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac);
  *
  * Returns: NULL or the located fcoe_softc
  */
-static struct fcoe_softc *fcoe_hostlist_lookup_softc(
-       const struct net_device *dev)
+static struct fcoe_softc *
+fcoe_hostlist_lookup_softc(const struct net_device *dev)
 {
        struct fcoe_softc *fc;
 
@@ -1329,7 +1329,7 @@ int fcoe_hostlist_add(const struct fc_lport *lp)
 
        fc = fcoe_hostlist_lookup_softc(fcoe_netdev(lp));
        if (!fc) {
-               fc = fcoe_softc(lp);
+               fc = lport_priv(lp);
                write_lock_bh(&fcoe_hostlist_lock);
                list_add_tail(&fc->list, &fcoe_hostlist);
                write_unlock_bh(&fcoe_hostlist_lock);
@@ -1426,7 +1426,6 @@ static int __init fcoe_init(void)
                        } else {
                                fcoe_percpu[cpu] = NULL;
                                kfree(p);
-
                        }
                }
        }
@@ -1436,11 +1435,9 @@ static int __init fcoe_init(void)
         */
        fcoe_dev_setup();
 
-       init_timer(&fcoe_timer);
-       fcoe_timer.data = 0;
-       fcoe_timer.function = fcoe_watchdog;
-       fcoe_timer.expires = (jiffies + (10 * HZ));
-       add_timer(&fcoe_timer);
+       setup_timer(&fcoe_timer, fcoe_watchdog, 0);
+
+       mod_timer(&fcoe_timer, jiffies + (10 * HZ));
 
        /* initiatlize the fcoe transport */
        fcoe_transport_init();
@@ -1476,7 +1473,7 @@ static void __exit fcoe_exit(void)
         */
        del_timer_sync(&fcoe_timer);
 
-       /* releases the assocaited fcoe transport for each lport */
+       /* releases the associated fcoe transport for each lport */
        list_for_each_entry_safe(fc, tmp, &fcoe_hostlist, list)
                fcoe_transport_release(fc->real_dev);