[PATCH] Serial: No need to check for priv != NULL in remove_one
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
fbc0dc0df5
commit
056a8763fc
|
@ -1766,13 +1766,11 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
|
||||||
static void __devexit pciserial_remove_one(struct pci_dev *dev)
|
static void __devexit pciserial_remove_one(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
struct serial_private *priv = pci_get_drvdata(dev);
|
struct serial_private *priv = pci_get_drvdata(dev);
|
||||||
|
|
||||||
pci_set_drvdata(dev, NULL);
|
|
||||||
|
|
||||||
if (priv) {
|
|
||||||
struct pci_serial_quirk *quirk;
|
struct pci_serial_quirk *quirk;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
pci_set_drvdata(dev, NULL);
|
||||||
|
|
||||||
for (i = 0; i < priv->nr; i++)
|
for (i = 0; i < priv->nr; i++)
|
||||||
serial8250_unregister_port(priv->line[i]);
|
serial8250_unregister_port(priv->line[i]);
|
||||||
|
|
||||||
|
@ -1792,7 +1790,6 @@ static void __devexit pciserial_remove_one(struct pci_dev *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)
|
static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
|
||||||
|
|
Loading…
Reference in New Issue