[module] fix compile on >= 5.9.0

fixes #314
This commit is contained in:
Geoffrey McRae 2020-10-30 16:13:29 +11:00
parent fd2801a670
commit 3de2641d92
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
PACKAGE_NAME="kvmfr" PACKAGE_NAME="kvmfr"
PACKAGE_VERSION="0.0.2" PACKAGE_VERSION="0.0.3"
BUILT_MODULE_NAME[0]="${PACKAGE_NAME}" BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
MAKE[0]="make KDIR=${kernel_source_dir}" MAKE[0]="make KDIR=${kernel_source_dir}"
CLEAN="make KDIR=${kernel_source_dir} clean" CLEAN="make KDIR=${kernel_source_dir} clean"

View File

@ -37,7 +37,7 @@ DEFINE_MUTEX(minor_lock);
DEFINE_IDR(kvmfr_idr); DEFINE_IDR(kvmfr_idr);
#define KVMFR_UIO_NAME "KVMFR" #define KVMFR_UIO_NAME "KVMFR"
#define KVMFR_UIO_VER "0.0.2" #define KVMFR_UIO_VER "0.0.3"
#define KVMFR_DEV_NAME "kvmfr" #define KVMFR_DEV_NAME "kvmfr"
#define KVMFR_MAX_DEVICES 10 #define KVMFR_MAX_DEVICES 10
@ -280,7 +280,12 @@ static int kvmfr_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
kdev->pgmap.res.start = pci_resource_start(dev, 2); kdev->pgmap.res.start = pci_resource_start(dev, 2);
kdev->pgmap.res.end = pci_resource_end (dev, 2); kdev->pgmap.res.end = pci_resource_end (dev, 2);
kdev->pgmap.res.flags = pci_resource_flags(dev, 2); kdev->pgmap.res.flags = pci_resource_flags(dev, 2);
kdev->pgmap.type = MEMORY_DEVICE_DEVDAX;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
kdev->pgmap.type = MEMORY_DEVICE_DEVDAX;
#else
kdev->pgmap.type = MEMORY_DEVICE_GENERIC;
#endif
kdev->addr = devm_memremap_pages(&dev->dev, &kdev->pgmap); kdev->addr = devm_memremap_pages(&dev->dev, &kdev->pgmap);
if (IS_ERR(kdev->addr)) if (IS_ERR(kdev->addr))