]> Pileus Git - ~andy/linux/blobdiff - drivers/hv/vmbus_drv.c
Merge tag 'gpio-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[~andy/linux] / drivers / hv / vmbus_drv.c
index 4748086eaaf26ad41bd3b2fb0c7e40be4a34e054..8e1a9ec5300328eee7bb22a71c47c42f31ad5aa9 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/completion.h>
 #include <linux/hyperv.h>
 #include <asm/hyperv.h>
+#include <asm/hypervisor.h>
 #include "hyperv_vmbus.h"
 
 
@@ -146,43 +147,9 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
        get_channel_info(hv_dev, device_info);
 
        if (!strcmp(dev_attr->attr.name, "class_id")) {
-               ret = sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-                              "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
-                              device_info->chn_type.b[3],
-                              device_info->chn_type.b[2],
-                              device_info->chn_type.b[1],
-                              device_info->chn_type.b[0],
-                              device_info->chn_type.b[5],
-                              device_info->chn_type.b[4],
-                              device_info->chn_type.b[7],
-                              device_info->chn_type.b[6],
-                              device_info->chn_type.b[8],
-                              device_info->chn_type.b[9],
-                              device_info->chn_type.b[10],
-                              device_info->chn_type.b[11],
-                              device_info->chn_type.b[12],
-                              device_info->chn_type.b[13],
-                              device_info->chn_type.b[14],
-                              device_info->chn_type.b[15]);
+               ret = sprintf(buf, "{%pUl}\n", device_info->chn_type.b);
        } else if (!strcmp(dev_attr->attr.name, "device_id")) {
-               ret = sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
-                              "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
-                              device_info->chn_instance.b[3],
-                              device_info->chn_instance.b[2],
-                              device_info->chn_instance.b[1],
-                              device_info->chn_instance.b[0],
-                              device_info->chn_instance.b[5],
-                              device_info->chn_instance.b[4],
-                              device_info->chn_instance.b[7],
-                              device_info->chn_instance.b[6],
-                              device_info->chn_instance.b[8],
-                              device_info->chn_instance.b[9],
-                              device_info->chn_instance.b[10],
-                              device_info->chn_instance.b[11],
-                              device_info->chn_instance.b[12],
-                              device_info->chn_instance.b[13],
-                              device_info->chn_instance.b[14],
-                              device_info->chn_instance.b[15]);
+               ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b);
        } else if (!strcmp(dev_attr->attr.name, "modalias")) {
                print_alias_name(hv_dev, alias_name);
                ret = sprintf(buf, "vmbus:%s\n", alias_name);
@@ -757,6 +724,9 @@ static int __init hv_acpi_init(void)
 {
        int ret, t;
 
+       if (x86_hyper != &x86_hyper_ms_hyperv)
+               return -ENODEV;
+
        init_completion(&probe_event);
 
        /*