소스 검색

PCI: fix up error messages for pci_bus registering

Due to the class_device cleanup of pci_bus, the error messages when
things go wrong are incorrect.  So fix this up to properly report what
is really happening, if things go wrong.

Thanks to Kay for pointing out the issue.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Greg Kroah-Hartman 18 년 전
부모
커밋
4725e7bdb8
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      drivers/pci/bus.c

+ 6 - 4
drivers/pci/bus.c

@@ -145,13 +145,15 @@ void pci_bus_add_devices(struct pci_bus *bus)
 			child_bus = dev->subordinate;
 			child_bus->dev.parent = child_bus->bridge;
 			retval = device_register(&child_bus->dev);
-			if (!retval)
+			if (retval)
+				dev_err(&dev->dev, "Error registering pci_bus,"
+					" continuing...\n");
+			else
 				retval = device_create_file(&child_bus->dev,
 							&dev_attr_cpuaffinity);
 			if (retval)
-				dev_err(&dev->dev, "Error registering pci_bus"
-					" device bridge symlink,"
-					" continuing...\n");
+				dev_err(&dev->dev, "Error creating cpuaffinity"
+					" file, continuing...\n");
 		}
 	}
 }