svn commit: r240700 - head/sys/dev/nvme

Jim Harris jimharris at FreeBSD.org
Wed Sep 19 18:25:26 UTC 2012


Author: jimharris
Date: Wed Sep 19 18:25:25 2012
New Revision: 240700
URL: http://svn.freebsd.org/changeset/base/240700

Log:
  In nvme(4), set device description for BUS_PROBE_GENERIC case.
  
  Reported by:	jhb

Modified:
  head/sys/dev/nvme/nvme.c

Modified: head/sys/dev/nvme/nvme.c
==============================================================================
--- head/sys/dev/nvme/nvme.c	Wed Sep 19 18:22:14 2012	(r240699)
+++ head/sys/dev/nvme/nvme.c	Wed Sep 19 18:25:25 2012	(r240700)
@@ -84,28 +84,29 @@ static int
 nvme_probe (device_t device)
 {
 	struct _pcsid	*ep;
-	int		probe_val = ENXIO;
 	u_int32_t	type;
 
 	type = pci_get_devid(device);
 	ep = pci_ids;
 
-#if defined(PCIS_STORAGE_NVM)
-	if (pci_get_class(device)    == PCIC_STORAGE &&
-	    pci_get_subclass(device) == PCIS_STORAGE_NVM &&
-	    pci_get_progif(device)   == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0)
-		probe_val = BUS_PROBE_GENERIC;
-#endif
-
 	while (ep->type && ep->type != type)
 		++ep;
 
 	if (ep->desc) {
 		device_set_desc(device, ep->desc);
-		probe_val = BUS_PROBE_DEFAULT;
+		return (BUS_PROBE_DEFAULT);
 	}
 
-	return (probe_val);
+#if defined(PCIS_STORAGE_NVM)
+	if (pci_get_class(device)    == PCIC_STORAGE &&
+	    pci_get_subclass(device) == PCIS_STORAGE_NVM &&
+	    pci_get_progif(device)   == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) {
+		device_set_desc(device, "Generic NVMe Device");
+		return (BUS_PROBE_GENERIC);
+	}
+#endif
+
+	return (ENXIO);
 }
 
 static void


More information about the svn-src-all mailing list