summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/utilities/hv_timesync.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2017-01-04 05:07:39 +0000
committersephe <sephe@FreeBSD.org>2017-01-04 05:07:39 +0000
commit3227e1b8ab81e6f1fa7296665c81305a5e6256c2 (patch)
tree2b211e4399cfb636b063470e0ca301e8085228c4 /sys/dev/hyperv/utilities/hv_timesync.c
parent338d3ffcba1c165acfeba5ea7f903c99af047466 (diff)
downloadFreeBSD-src-3227e1b8ab81e6f1fa7296665c81305a5e6256c2.zip
FreeBSD-src-3227e1b8ab81e6f1fa7296665c81305a5e6256c2.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_timesync.c')
-rw-r--r--sys/dev/hyperv/utilities/hv_timesync.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/sys/dev/hyperv/utilities/hv_timesync.c b/sys/dev/hyperv/utilities/hv_timesync.c
index 350b764..89e6b47 100644
--- a/sys/dev/hyperv/utilities/hv_timesync.c
+++ b/sys/dev/hyperv/utilities/hv_timesync.c
@@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$");
((sc)->ic_msgver >= VMBUS_IC_VERSION(4, 0) && \
(hyperv_features & CPUID_HV_MSR_TIME_REFCNT))
+static int vmbus_timesync_probe(device_t);
+static int vmbus_timesync_attach(device_t);
+
static const struct vmbus_ic_desc vmbus_timesync_descs[] = {
{
.ic_guid = { .hv_guid = {
@@ -62,6 +65,27 @@ static const struct vmbus_ic_desc vmbus_timesync_descs[] = {
VMBUS_IC_DESC_END
};
+static device_method_t vmbus_timesync_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, vmbus_timesync_probe),
+ DEVMETHOD(device_attach, vmbus_timesync_attach),
+ DEVMETHOD(device_detach, vmbus_ic_detach),
+ DEVMETHOD_END
+};
+
+static driver_t vmbus_timesync_driver = {
+ "hvtimesync",
+ vmbus_timesync_methods,
+ sizeof(struct vmbus_ic_softc)
+};
+
+static devclass_t vmbus_timesync_devclass;
+
+DRIVER_MODULE(hv_timesync, vmbus, vmbus_timesync_driver,
+ vmbus_timesync_devclass, NULL, NULL);
+MODULE_VERSION(hv_timesync, 1);
+MODULE_DEPEND(hv_timesync, vmbus, 1, 1, 1);
+
SYSCTL_NODE(_hw, OID_AUTO, hvtimesync, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
"Hyper-V timesync interface");
@@ -207,35 +231,15 @@ vmbus_timesync_cb(struct vmbus_channel *chan, void *xsc)
}
static int
-hv_timesync_probe(device_t dev)
+vmbus_timesync_probe(device_t dev)
{
return (vmbus_ic_probe(dev, vmbus_timesync_descs));
}
static int
-hv_timesync_attach(device_t dev)
+vmbus_timesync_attach(device_t dev)
{
return (vmbus_ic_attach(dev, vmbus_timesync_cb));
}
-
-static device_method_t timesync_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, hv_timesync_probe),
- DEVMETHOD(device_attach, hv_timesync_attach),
- DEVMETHOD(device_detach, vmbus_ic_detach),
- { 0, 0 }
-};
-
-static driver_t timesync_driver = {
- "hvtimesync",
- timesync_methods,
- sizeof(struct vmbus_ic_softc)
-};
-
-static devclass_t timesync_devclass;
-
-DRIVER_MODULE(hv_timesync, vmbus, timesync_driver, timesync_devclass, NULL, NULL);
-MODULE_VERSION(hv_timesync, 1);
-MODULE_DEPEND(hv_timesync, vmbus, 1, 1, 1);
OpenPOWER on IntegriCloud