View | Details | Raw Unified | Return to bug 211852
Collapse All | Expand All

(-)sys/dev/nvme/nvme.c (-15 / +7 lines)
Lines 58-63 Link Here
58
static int    nvme_probe(device_t);
58
static int    nvme_probe(device_t);
59
static int    nvme_attach(device_t);
59
static int    nvme_attach(device_t);
60
static int    nvme_detach(device_t);
60
static int    nvme_detach(device_t);
61
static int    nvme_shutdown(device_t);
61
static int    nvme_modevent(module_t mod, int type, void *arg);
62
static int    nvme_modevent(module_t mod, int type, void *arg);
62
63
63
static devclass_t nvme_devclass;
64
static devclass_t nvme_devclass;
Lines 67-72 Link Here
67
	DEVMETHOD(device_probe,     nvme_probe),
68
	DEVMETHOD(device_probe,     nvme_probe),
68
	DEVMETHOD(device_attach,    nvme_attach),
69
	DEVMETHOD(device_attach,    nvme_attach),
69
	DEVMETHOD(device_detach,    nvme_detach),
70
	DEVMETHOD(device_detach,    nvme_detach),
71
	DEVMETHOD(device_shutdown,  nvme_shutdown),
70
	{ 0, 0 }
72
	{ 0, 0 }
71
};
73
};
72
74
Lines 179-200 Link Here
179
{
181
{
180
}
182
}
181
183
182
static void
184
static int
183
nvme_shutdown(void)
185
nvme_shutdown(device_t dev)
184
{
186
{
185
	device_t		*devlist;
186
	struct nvme_controller	*ctrlr;
187
	struct nvme_controller	*ctrlr;
187
	int			dev, devcount;
188
188
189
	if (devclass_get_devices(nvme_devclass, &devlist, &devcount))
189
	ctrlr = DEVICE2SOFTC(dev);
190
		return;
190
	nvme_ctrlr_shutdown(ctrlr);
191
191
192
	for (dev = 0; dev < devcount; dev++) {
192
	return (0);
193
		ctrlr = DEVICE2SOFTC(devlist[dev]);
194
		nvme_ctrlr_shutdown(ctrlr);
195
	}
196
197
	free(devlist, M_TEMP);
198
}
193
}
199
194
200
static int
195
static int
Lines 208-216 Link Here
208
	case MOD_UNLOAD:
203
	case MOD_UNLOAD:
209
		nvme_unload();
204
		nvme_unload();
210
		break;
205
		break;
211
	case MOD_SHUTDOWN:
212
		nvme_shutdown();
213
		break;
214
	default:
206
	default:
215
		break;
207
		break;
216
	}
208
	}

Return to bug 211852