Commit 2cd556ae authored by Stefan Richter's avatar Stefan Richter

ieee1394: eth1394: clean up host removal

ether1394_add_host() guarantees that hi->dev != NULL if hi != NULL.
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 157188cb
...@@ -655,24 +655,17 @@ static void ether1394_add_host (struct hpsb_host *host) ...@@ -655,24 +655,17 @@ static void ether1394_add_host (struct hpsb_host *host)
static void ether1394_remove_host (struct hpsb_host *host) static void ether1394_remove_host (struct hpsb_host *host)
{ {
struct eth1394_host_info *hi; struct eth1394_host_info *hi;
struct eth1394_priv *priv;
hi = hpsb_get_hostinfo(&eth1394_highlevel, host); hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
if (hi != NULL) { if (!hi)
struct eth1394_priv *priv = netdev_priv(hi->dev); return;
priv = netdev_priv(hi->dev);
hpsb_unregister_addrspace(&eth1394_highlevel, host, hpsb_unregister_addrspace(&eth1394_highlevel, host, priv->local_fifo);
priv->local_fifo); if (priv->iso)
if (priv->iso != NULL)
hpsb_iso_shutdown(priv->iso); hpsb_iso_shutdown(priv->iso);
unregister_netdev(hi->dev);
if (hi->dev) {
unregister_netdev (hi->dev);
free_netdev(hi->dev); free_netdev(hi->dev);
}
}
return;
} }
/* A reset has just arisen */ /* A reset has just arisen */
...@@ -689,7 +682,7 @@ static void ether1394_host_reset (struct hpsb_host *host) ...@@ -689,7 +682,7 @@ static void ether1394_host_reset (struct hpsb_host *host)
hi = hpsb_get_hostinfo(&eth1394_highlevel, host); hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
/* This can happen for hosts that we don't use */ /* This can happen for hosts that we don't use */
if (hi == NULL) if (!hi)
return; return;
dev = hi->dev; dev = hi->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment