]> err.no Git - linux-2.6/commitdiff
ieee1394: eth1394: clean up host removal
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 10 Feb 2007 22:57:57 +0000 (23:57 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 29 Apr 2007 22:00:30 +0000 (00:00 +0200)
ether1394_add_host() guarantees that hi->dev != NULL if hi != NULL.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/eth1394.c

index e2b84c9b83bb832346d285c7078bcced1c13c1c5..63fca140ab90a9d0cb2c6eef05bb9b0120036b4e 100644 (file)
@@ -655,24 +655,17 @@ out:
 static void ether1394_remove_host (struct hpsb_host *host)
 {
        struct eth1394_host_info *hi;
+       struct eth1394_priv *priv;
 
        hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
-       if (hi != NULL) {
-               struct eth1394_priv *priv = netdev_priv(hi->dev);
-
-               hpsb_unregister_addrspace(&eth1394_highlevel, host,
-                                         priv->local_fifo);
-
-               if (priv->iso != NULL)
-                       hpsb_iso_shutdown(priv->iso);
-
-               if (hi->dev) {
-                       unregister_netdev (hi->dev);
-                       free_netdev(hi->dev);
-               }
-       }
-
-       return;
+       if (!hi)
+               return;
+       priv = netdev_priv(hi->dev);
+       hpsb_unregister_addrspace(&eth1394_highlevel, host, priv->local_fifo);
+       if (priv->iso)
+               hpsb_iso_shutdown(priv->iso);
+       unregister_netdev(hi->dev);
+       free_netdev(hi->dev);
 }
 
 /* A reset has just arisen */
@@ -689,7 +682,7 @@ static void ether1394_host_reset (struct hpsb_host *host)
        hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
 
        /* This can happen for hosts that we don't use */
-       if (hi == NULL)
+       if (!hi)
                return;
 
        dev = hi->dev;