Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137669402
D35062.id105752.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35062.id105752.diff
View Options
diff --git a/sys/dev/nvdimm/nvdimm.c b/sys/dev/nvdimm/nvdimm.c
--- a/sys/dev/nvdimm/nvdimm.c
+++ b/sys/dev/nvdimm/nvdimm.c
@@ -301,27 +301,6 @@
return (0);
}
-struct nvdimm_dev *
-nvdimm_find_by_handle(nfit_handle_t nv_handle)
-{
- struct nvdimm_dev *res;
- device_t *dimms;
- int i, error, num_dimms;
-
- res = NULL;
- error = devclass_get_devices(nvdimm_devclass, &dimms, &num_dimms);
- if (error != 0)
- return (NULL);
- for (i = 0; i < num_dimms; i++) {
- if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) {
- res = device_get_softc(dimms[i]);
- break;
- }
- }
- free(dimms, M_TEMP);
- return (res);
-}
-
static int
nvdimm_probe(device_t dev)
{
@@ -468,6 +447,28 @@
sizeof(struct nvdimm_dev),
};
+struct nvdimm_dev *
+nvdimm_find_by_handle(nfit_handle_t nv_handle)
+{
+ struct nvdimm_dev *res;
+ device_t *dimms;
+ int i, error, num_dimms;
+
+ res = NULL;
+ error = devclass_get_devices(devclass_find(nvdimm_driver.name), &dimms,
+ &num_dimms);
+ if (error != 0)
+ return (NULL);
+ for (i = 0; i < num_dimms; i++) {
+ if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) {
+ res = device_get_softc(dimms[i]);
+ break;
+ }
+ }
+ free(dimms, M_TEMP);
+ return (res);
+}
+
DRIVER_MODULE(nvdimm, nvdimm_acpi_root, nvdimm_driver, nvdimm_devclass, NULL,
NULL);
MODULE_DEPEND(nvdimm, acpi, 1, 1, 1);
diff --git a/sys/dev/nvdimm/nvdimm_e820.c b/sys/dev/nvdimm/nvdimm_e820.c
--- a/sys/dev/nvdimm/nvdimm_e820.c
+++ b/sys/dev/nvdimm/nvdimm_e820.c
@@ -367,7 +367,7 @@
switch (e) {
case MOD_UNLOAD:
- dc = nvdimm_e820_devclass;
+ dc = devclass_find(nvdimm_e820_driver.name);
maxunit = devclass_get_maxunit(dc);
for (i = 0; i < maxunit; i++) {
dev = devclass_get_device(dc, i);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 25, 8:44 PM (11 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26174734
Default Alt Text
D35062.id105752.diff (1 KB)
Attached To
Mode
D35062: nvdimm: Use devclass_lookup to find devclasses.
Attached
Detach File
Event Timeline
Log In to Comment