summaryrefslogtreecommitdiff
path: root/drivers/pci/pcie/portdrv_pci.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-07-08 22:58:25 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-26 17:43:52 -0700
commit20d516602c022997feb24a9f1a806fc986b9e4e8 (patch)
treecf74447266832d62cdb38e7ca29532c65848b60e /drivers/pci/pcie/portdrv_pci.c
parent6397c75cbc4d7dbc3d07278b57c82a47dafb21b5 (diff)
PCIE: check and return bus_register errors
Have pcie_port_bus_register() notice and return errors. Mark it __must_check so that its caller(s) must check its return value. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pcie/portdrv_pci.c')
-rw-r--r--drivers/pci/pcie/portdrv_pci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 478d0d28f7ad..3284199ce396 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -129,12 +129,17 @@ static struct pci_driver pcie_portdrv = {
static int __init pcie_portdrv_init(void)
{
- int retval = 0;
+ int retval;
- pcie_port_bus_register();
+ retval = pcie_port_bus_register();
+ if (retval) {
+ printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval);
+ goto out;
+ }
retval = pci_register_driver(&pcie_portdrv);
if (retval)
pcie_port_bus_unregister();
+ out:
return retval;
}