Commit f166b498 authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman

parport_serial: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9cfb5e30
...@@ -596,13 +596,11 @@ static int parport_serial_pci_probe(struct pci_dev *dev, ...@@ -596,13 +596,11 @@ static int parport_serial_pci_probe(struct pci_dev *dev,
err = pci_enable_device (dev); err = pci_enable_device (dev);
if (err) { if (err) {
pci_set_drvdata (dev, NULL);
kfree (priv); kfree (priv);
return err; return err;
} }
if (parport_register (dev, id)) { if (parport_register (dev, id)) {
pci_set_drvdata (dev, NULL);
kfree (priv); kfree (priv);
return -ENODEV; return -ENODEV;
} }
...@@ -611,7 +609,6 @@ static int parport_serial_pci_probe(struct pci_dev *dev, ...@@ -611,7 +609,6 @@ static int parport_serial_pci_probe(struct pci_dev *dev,
int i; int i;
for (i = 0; i < priv->num_par; i++) for (i = 0; i < priv->num_par; i++)
parport_pc_unregister_port (priv->port[i]); parport_pc_unregister_port (priv->port[i]);
pci_set_drvdata (dev, NULL);
kfree (priv); kfree (priv);
return -ENODEV; return -ENODEV;
} }
...@@ -624,8 +621,6 @@ static void parport_serial_pci_remove(struct pci_dev *dev) ...@@ -624,8 +621,6 @@ static void parport_serial_pci_remove(struct pci_dev *dev)
struct parport_serial_private *priv = pci_get_drvdata (dev); struct parport_serial_private *priv = pci_get_drvdata (dev);
int i; int i;
pci_set_drvdata(dev, NULL);
// Serial ports // Serial ports
if (priv->serial) if (priv->serial)
pciserial_remove_ports(priv->serial); pciserial_remove_ports(priv->serial);
......
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