Skip to content

Commit

Permalink
parport_serial: remove unnecessary pci_set_drvdata()
Browse files Browse the repository at this point in the history
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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Dec 9, 2013
1 parent 9cfb5e3 commit f166b49
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/parport/parport_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,11 @@ static int parport_serial_pci_probe(struct pci_dev *dev,

err = pci_enable_device (dev);
if (err) {
pci_set_drvdata (dev, NULL);
kfree (priv);
return err;
}

if (parport_register (dev, id)) {
pci_set_drvdata (dev, NULL);
kfree (priv);
return -ENODEV;
}
Expand All @@ -611,7 +609,6 @@ static int parport_serial_pci_probe(struct pci_dev *dev,
int i;
for (i = 0; i < priv->num_par; i++)
parport_pc_unregister_port (priv->port[i]);
pci_set_drvdata (dev, NULL);
kfree (priv);
return -ENODEV;
}
Expand All @@ -624,8 +621,6 @@ static void parport_serial_pci_remove(struct pci_dev *dev)
struct parport_serial_private *priv = pci_get_drvdata (dev);
int i;

pci_set_drvdata(dev, NULL);

// Serial ports
if (priv->serial)
pciserial_remove_ports(priv->serial);
Expand Down

0 comments on commit f166b49

Please sign in to comment.