All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 13/24] drivers/pci: return actual error on pci_slot_init
@ 2014-06-17 14:31 Jeff Liu
  2014-06-17 19:23 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2014-06-17 14:31 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci

From: Jie Liu <jeff.liu@oracle.com>

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

Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-17 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-17 14:31 [PATCH 13/24] drivers/pci: return actual error on pci_slot_init Jeff Liu
2014-06-17 19:23 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.