diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-07-22 05:15:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-07-22 05:15:04 -0400 |
commit | 056a8763fc036639441a6dc49b61e57bc632af6e (patch) | |
tree | 880795a56d5f1ecf77966d14be38c4234436c2eb /drivers/serial/8250_pci.c | |
parent | fbc0dc0df54be06586d712ebf6958816e3b1b2b7 (diff) |
[PATCH] Serial: No need to check for priv != NULL in remove_one
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/8250_pci.c')
-rw-r--r-- | drivers/serial/8250_pci.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index c3f55f5a38de..356f5556759a 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -1766,33 +1766,30 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) | |||
1766 | static void __devexit pciserial_remove_one(struct pci_dev *dev) | 1766 | static void __devexit pciserial_remove_one(struct pci_dev *dev) |
1767 | { | 1767 | { |
1768 | struct serial_private *priv = pci_get_drvdata(dev); | 1768 | struct serial_private *priv = pci_get_drvdata(dev); |
1769 | struct pci_serial_quirk *quirk; | ||
1770 | int i; | ||
1769 | 1771 | ||
1770 | pci_set_drvdata(dev, NULL); | 1772 | pci_set_drvdata(dev, NULL); |
1771 | 1773 | ||
1772 | if (priv) { | 1774 | for (i = 0; i < priv->nr; i++) |
1773 | struct pci_serial_quirk *quirk; | 1775 | serial8250_unregister_port(priv->line[i]); |
1774 | int i; | ||
1775 | |||
1776 | for (i = 0; i < priv->nr; i++) | ||
1777 | serial8250_unregister_port(priv->line[i]); | ||
1778 | 1776 | ||
1779 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { | 1777 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { |
1780 | if (priv->remapped_bar[i]) | 1778 | if (priv->remapped_bar[i]) |
1781 | iounmap(priv->remapped_bar[i]); | 1779 | iounmap(priv->remapped_bar[i]); |
1782 | priv->remapped_bar[i] = NULL; | 1780 | priv->remapped_bar[i] = NULL; |
1783 | } | 1781 | } |
1784 | 1782 | ||
1785 | /* | 1783 | /* |
1786 | * Find the exit quirks. | 1784 | * Find the exit quirks. |
1787 | */ | 1785 | */ |
1788 | quirk = find_quirk(dev); | 1786 | quirk = find_quirk(dev); |
1789 | if (quirk->exit) | 1787 | if (quirk->exit) |
1790 | quirk->exit(dev); | 1788 | quirk->exit(dev); |
1791 | 1789 | ||
1792 | pci_disable_device(dev); | 1790 | pci_disable_device(dev); |
1793 | 1791 | ||
1794 | kfree(priv); | 1792 | kfree(priv); |
1795 | } | ||
1796 | } | 1793 | } |
1797 | 1794 | ||
1798 | static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state) | 1795 | static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state) |