Merge tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kerne...
[firefly-linux-kernel-4.4.55.git] / drivers / char / tpm / xen-tpmfront.c
index 92b097064df544e895cfe9de2371f393f163ab7a..2064b4527040be68920c3ef9e557b090ca587f7a 100644 (file)
@@ -17,6 +17,7 @@
 #include <xen/xenbus.h>
 #include <xen/page.h>
 #include "tpm.h"
+#include <xen/platform_pci.h>
 
 struct tpm_private {
        struct tpm_chip *chip;
@@ -378,6 +379,9 @@ static int __init xen_tpmfront_init(void)
        if (!xen_domain())
                return -ENODEV;
 
+       if (!xen_has_pv_devices())
+               return -ENODEV;
+
        return xenbus_register_frontend(&tpmfront_driver);
 }
 module_init(xen_tpmfront_init);