[PATCH 13/24] drivers/pci: return actual error on pci_slot_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jie Liu <jeff.liu@xxxxxxxxxx>

Return the actual error code if call kset_create_and_add() failed
at pci_slot_init().

Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
---
 drivers/pci/slot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 396c200..dddb46a 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -387,9 +387,9 @@ static int pci_slot_init(void)
 	pci_bus_kset = bus_get_kset(&pci_bus_type);
 	pci_slots_kset = kset_create_and_add("slots", NULL,
 						&pci_bus_kset->kobj);
-	if (!pci_slots_kset) {
+	if (IS_ERR(pci_slots_kset)) {
 		printk(KERN_ERR "PCI: Slot initialization failure\n");
-		return -ENOMEM;
+		return PTR_ERR(pci_slots_kset);
 	}
 	return 0;
 }
-- 
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux