minor cleanup
diff --git a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
index f250660..2f0d5d8 100644
--- a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
+++ b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
@@ -166,10 +166,11 @@
      *
      * @param port the port
      */
-    public void removePort(final OFPort port) {
+    public void removePort(final OFPortDesc port) {
         // Ignore ports that are not on this switch
 
-        int portnum = port.getPortNumber();
+        int portnum = port.getPortNo().getPortNumber();
+        this.ports.remove(portnum);
         synchronized (this) {
             if (this.slowPorts.contains(portnum)) {
                 this.slowPorts.remove(portnum);
@@ -383,7 +384,7 @@
 
     public void removeAllPorts() {
         for (OFPortDesc port : sw.getPorts()) {
-            removePort(port.getPortNo());
+            removePort(port);
         }
     }
 
diff --git a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
index af0bb65..2de4b8c 100644
--- a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
+++ b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
@@ -125,7 +125,7 @@
                         DeviceId.deviceId("of:" + Long.toHexString(dpid.value())),
                         PortNumber.portNumber(port.getPortNo().getPortNumber()));
                 providerService.linksVanished(cp);
-                ld.removePort(port.getPortNo());
+                ld.removePort(port);
             }
 
         }