PCI: Remove unnecessary variable in pci_add_dynid()

The variable "retval" in pci_add_dynid() is only used to store the return
value of driver_attach() and is then directly returned.  Remove the
variable and directly pass on driver_attach()'s return value.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
Tobias Klauser 2014-07-25 10:36:14 +02:00 committed by Bjorn Helgaas
parent 52addcf9d6
commit 3b7f101662

View File

@ -55,7 +55,6 @@ int pci_add_dynid(struct pci_driver *drv,
unsigned long driver_data) unsigned long driver_data)
{ {
struct pci_dynid *dynid; struct pci_dynid *dynid;
int retval;
dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);
if (!dynid) if (!dynid)
@ -73,9 +72,7 @@ int pci_add_dynid(struct pci_driver *drv,
list_add_tail(&dynid->node, &drv->dynids.list); list_add_tail(&dynid->node, &drv->dynids.list);
spin_unlock(&drv->dynids.lock); spin_unlock(&drv->dynids.lock);
retval = driver_attach(&drv->driver); return driver_attach(&drv->driver);
return retval;
} }
EXPORT_SYMBOL_GPL(pci_add_dynid); EXPORT_SYMBOL_GPL(pci_add_dynid);