summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/utilities/hv_shutdown.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2017-01-05 08:27:55 +0000
committersephe <sephe@FreeBSD.org>2017-01-05 08:27:55 +0000
commit9755d80ddf7f6f467b77f883283368735b67b132 (patch)
tree84ba82b5d069b9a9ae07e32347a4537064952e27 /sys/dev/hyperv/utilities/hv_shutdown.c
parent3ea95a114bad3314b8db96880acd6976d0682352 (diff)
downloadFreeBSD-src-9755d80ddf7f6f467b77f883283368735b67b132.zip
FreeBSD-src-9755d80ddf7f6f467b77f883283368735b67b132.tar.gz
MFC 310318
hyperv/ic: Cleanup driver glue. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8849
Diffstat (limited to 'sys/dev/hyperv/utilities/hv_shutdown.c')
-rw-r--r--sys/dev/hyperv/utilities/hv_shutdown.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/sys/dev/hyperv/utilities/hv_shutdown.c b/sys/dev/hyperv/utilities/hv_shutdown.c
index dd96432..7e54dc9 100644
--- a/sys/dev/hyperv/utilities/hv_shutdown.c
+++ b/sys/dev/hyperv/utilities/hv_shutdown.c
@@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$");
#define VMBUS_SHUTDOWN_MSGVER \
VMBUS_IC_VERSION(VMBUS_SHUTDOWN_MSGVER_MAJOR, 0)
+static int vmbus_shutdown_probe(device_t);
+static int vmbus_shutdown_attach(device_t);
+
static const struct vmbus_ic_desc vmbus_shutdown_descs[] = {
{
.ic_guid = { .hv_guid = {
@@ -57,6 +60,27 @@ static const struct vmbus_ic_desc vmbus_shutdown_descs[] = {
VMBUS_IC_DESC_END
};
+static device_method_t vmbus_shutdown_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, vmbus_shutdown_probe),
+ DEVMETHOD(device_attach, vmbus_shutdown_attach),
+ DEVMETHOD(device_detach, vmbus_ic_detach),
+ DEVMETHOD_END
+};
+
+static driver_t vmbus_shutdown_driver = {
+ "hvshutdown",
+ vmbus_shutdown_methods,
+ sizeof(struct vmbus_ic_softc)
+};
+
+static devclass_t vmbus_shutdown_devclass;
+
+DRIVER_MODULE(hv_shutdown, vmbus, vmbus_shutdown_driver,
+ vmbus_shutdown_devclass, NULL, NULL);
+MODULE_VERSION(hv_shutdown, 1);
+MODULE_DEPEND(hv_shutdown, vmbus, 1, 1, 1);
+
static void
vmbus_shutdown_cb(struct vmbus_channel *chan, void *xsc)
{
@@ -129,35 +153,15 @@ vmbus_shutdown_cb(struct vmbus_channel *chan, void *xsc)
}
static int
-hv_shutdown_probe(device_t dev)
+vmbus_shutdown_probe(device_t dev)
{
return (vmbus_ic_probe(dev, vmbus_shutdown_descs));
}
static int
-hv_shutdown_attach(device_t dev)
+vmbus_shutdown_attach(device_t dev)
{
return (vmbus_ic_attach(dev, vmbus_shutdown_cb));
}
-
-static device_method_t shutdown_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, hv_shutdown_probe),
- DEVMETHOD(device_attach, hv_shutdown_attach),
- DEVMETHOD(device_detach, vmbus_ic_detach),
- { 0, 0 }
-};
-
-static driver_t shutdown_driver = {
- "hvshutdown",
- shutdown_methods,
- sizeof(struct vmbus_ic_softc)
-};
-
-static devclass_t shutdown_devclass;
-
-DRIVER_MODULE(hv_shutdown, vmbus, shutdown_driver, shutdown_devclass, NULL, NULL);
-MODULE_VERSION(hv_shutdown, 1);
-MODULE_DEPEND(hv_shutdown, vmbus, 1, 1, 1);
OpenPOWER on IntegriCloud