]> err.no Git - linux-2.6/commitdiff
[PATCH] Serial: No need to check for priv != NULL in remove_one
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Fri, 22 Jul 2005 09:15:04 +0000 (10:15 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 22 Jul 2005 09:15:04 +0000 (10:15 +0100)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/8250_pci.c

index c3f55f5a38de9fccaf627246c33df92e000bb5de..356f5556759ab649415a3214d4ac48284624c75e 100644 (file)
@@ -1766,33 +1766,30 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
 static void __devexit pciserial_remove_one(struct pci_dev *dev)
 {
        struct serial_private *priv = pci_get_drvdata(dev);
+       struct pci_serial_quirk *quirk;
+       int i;
 
        pci_set_drvdata(dev, NULL);
 
-       if (priv) {
-               struct pci_serial_quirk *quirk;
-               int i;
-
-               for (i = 0; i < priv->nr; i++)
-                       serial8250_unregister_port(priv->line[i]);
+       for (i = 0; i < priv->nr; i++)
+               serial8250_unregister_port(priv->line[i]);
 
-               for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
-                       if (priv->remapped_bar[i])
-                               iounmap(priv->remapped_bar[i]);
-                       priv->remapped_bar[i] = NULL;
-               }
+       for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
+               if (priv->remapped_bar[i])
+                       iounmap(priv->remapped_bar[i]);
+               priv->remapped_bar[i] = NULL;
+       }
 
-               /*
-                * Find the exit quirks.
-                */
-               quirk = find_quirk(dev);
-               if (quirk->exit)
-                       quirk->exit(dev);
+       /*
+        * Find the exit quirks.
+        */
+       quirk = find_quirk(dev);
+       if (quirk->exit)
+               quirk->exit(dev);
 
-               pci_disable_device(dev);
+       pci_disable_device(dev);
 
-               kfree(priv);
-       }
+       kfree(priv);
 }
 
 static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)