From d737e80b17222c46fb4587220bc8eb38d9c652e6 Mon Sep 17 00:00:00 2001 From: Alex Van Damme Date: Mon, 23 Jul 2018 15:52:12 -0700 Subject: [PATCH] Enable Apex on ARM64, fix compile issue - Change from X86 only to X86 or ARM64 in Kconfig - refcount_read doesn't exist in 4.11, so use atomic_read instead. This is the same call that refcount_read in 4.12+ would make. Change-Id: I48c97dd8c14136dcccaa8378b3a931a7872e1289 --- Kconfig | 2 +- gasket_sysfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index c836389..970e299 100644 --- a/Kconfig +++ b/Kconfig @@ -2,7 +2,7 @@ menu "Gasket devices" config STAGING_GASKET_FRAMEWORK tristate "Gasket framework" - depends on PCI && X86_64 + depends on PCI && (X86_64 || ARM64) help This framework supports Gasket-compatible devices, such as Apex. It is required for any of the following module(s). diff --git a/gasket_sysfs.c b/gasket_sysfs.c index 1c5f750..197bf53 100644 --- a/gasket_sysfs.c +++ b/gasket_sysfs.c @@ -108,7 +108,7 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping) } mutex_lock(&mapping->mutex); - if (refcount_read(&mapping->refcount.refcount) == 0) + if (atomic_read(&mapping->refcount.refcount) == 0) gasket_nodev_error("Refcount is already 0!"); if (kref_put(&mapping->refcount, release_entry)) { gasket_nodev_info("Removing Gasket sysfs mapping, device %s",