Commit c893d133 authored by Yijing Wang's avatar Yijing Wang Committed by Bjorn Helgaas

PCI: Make pci_bus_add_device() void

pci_bus_add_device() always returns 0, so there's no point in returning
anything at all.  Make it a void function and remove the tests of the
return value from the callers.

[bhelgaas: changelog, remove unused "err" from i82875p_setup_overfl_dev()]
Signed-off-by: default avatarYijing Wang <wangyijing@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent d97ffe23
...@@ -275,7 +275,6 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev, ...@@ -275,7 +275,6 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
{ {
struct pci_dev *dev; struct pci_dev *dev;
void __iomem *window; void __iomem *window;
int err;
*ovrfl_pdev = NULL; *ovrfl_pdev = NULL;
*ovrfl_window = NULL; *ovrfl_window = NULL;
...@@ -293,12 +292,7 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev, ...@@ -293,12 +292,7 @@ static int i82875p_setup_overfl_dev(struct pci_dev *pdev,
if (dev == NULL) if (dev == NULL)
return 1; return 1;
err = pci_bus_add_device(dev); pci_bus_add_device(dev);
if (err) {
i82875p_printk(KERN_ERR,
"%s(): pci_bus_add_device() Failed\n",
__func__);
}
pci_bus_assign_resources(dev->bus); pci_bus_assign_resources(dev->bus);
} }
......
...@@ -235,7 +235,7 @@ void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { } ...@@ -235,7 +235,7 @@ void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { }
* *
* This adds add sysfs entries and start device drivers * This adds add sysfs entries and start device drivers
*/ */
int pci_bus_add_device(struct pci_dev *dev) void pci_bus_add_device(struct pci_dev *dev)
{ {
int retval; int retval;
...@@ -252,8 +252,6 @@ int pci_bus_add_device(struct pci_dev *dev) ...@@ -252,8 +252,6 @@ int pci_bus_add_device(struct pci_dev *dev)
WARN_ON(retval < 0); WARN_ON(retval < 0);
dev->is_added = 1; dev->is_added = 1;
return 0;
} }
/** /**
...@@ -266,16 +264,12 @@ void pci_bus_add_devices(const struct pci_bus *bus) ...@@ -266,16 +264,12 @@ void pci_bus_add_devices(const struct pci_bus *bus)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct pci_bus *child; struct pci_bus *child;
int retval;
list_for_each_entry(dev, &bus->devices, bus_list) { list_for_each_entry(dev, &bus->devices, bus_list) {
/* Skip already-added devices */ /* Skip already-added devices */
if (dev->is_added) if (dev->is_added)
continue; continue;
retval = pci_bus_add_device(dev); pci_bus_add_device(dev);
if (retval)
dev_err(&dev->dev, "Error adding device (%d)\n",
retval);
} }
list_for_each_entry(dev, &bus->devices, bus_list) { list_for_each_entry(dev, &bus->devices, bus_list) {
......
...@@ -106,7 +106,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset) ...@@ -106,7 +106,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
pci_device_add(virtfn, virtfn->bus); pci_device_add(virtfn, virtfn->bus);
mutex_unlock(&iov->dev->sriov->lock); mutex_unlock(&iov->dev->sriov->lock);
rc = pci_bus_add_device(virtfn); pci_bus_add_device(virtfn);
sprintf(buf, "virtfn%u", id); sprintf(buf, "virtfn%u", id);
rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf); rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf);
if (rc) if (rc)
......
...@@ -642,8 +642,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus) ...@@ -642,8 +642,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
dev = pci_scan_single_device(bus, 0); dev = pci_scan_single_device(bus, 0);
if (dev) { if (dev) {
pci_bus_assign_resources(bus); pci_bus_assign_resources(bus);
if (pci_bus_add_device(dev)) pci_bus_add_device(dev);
pr_err("Unable to hotplug wifi\n");
} }
} else { } else {
dev = pci_get_slot(bus, 0); dev = pci_get_slot(bus, 0);
......
...@@ -633,8 +633,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) ...@@ -633,8 +633,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
dev = pci_scan_single_device(bus, 0); dev = pci_scan_single_device(bus, 0);
if (dev) { if (dev) {
pci_bus_assign_resources(bus); pci_bus_assign_resources(bus);
if (pci_bus_add_device(dev)) pci_bus_add_device(dev);
pr_err("Unable to hotplug wifi\n");
} }
} else { } else {
dev = pci_get_slot(bus, 0); dev = pci_get_slot(bus, 0);
......
...@@ -764,7 +764,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); ...@@ -764,7 +764,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn);
struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
unsigned int pci_scan_child_bus(struct pci_bus *bus); unsigned int pci_scan_child_bus(struct pci_bus *bus);
int __must_check pci_bus_add_device(struct pci_dev *dev); void pci_bus_add_device(struct pci_dev *dev);
void pci_read_bridge_bases(struct pci_bus *child); void pci_read_bridge_bases(struct pci_bus *child);
struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *pci_find_parent_resource(const struct pci_dev *dev,
struct resource *res); struct resource *res);
......
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