Skip to content

Commit 820f80c

Browse files
authored
Merge pull request linuxwacom#357 from jigpu/centos-7.9
3.17: Change conditional compilation of devm_add_action_or_reset
2 parents cffc2ec + 8bccc69 commit 820f80c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

3.17/wacom_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static bool wacom_is_using_usb_driver(struct hid_device *hdev)
6262
usb_for_each_dev(hdev, __wacom_is_usb_parent);
6363
}
6464

65-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
65+
#ifndef WACOM_DEVM_OR_RESET
6666
static int devm_add_action_or_reset(struct device *dev,
6767
void (*action)(void *), void *data)
6868
{

configure.ac

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,21 @@ struct power_supply_desc test;
205205
AC_MSG_RESULT([pre-v4.1])
206206
])
207207

208+
dnl RedHat enterprise Linux 7.9 backports devm functions from 4.6
209+
AC_MSG_CHECKING(devm_add_action_or_reset)
210+
WACOM_LINUX_TRY_COMPILE([
211+
#include <linux/device.h>
212+
int devm_add_action_or_reset(struct device *dev, void (*action)(void *), void *data) { return 0; }
213+
],[
214+
],[
215+
HAVE_DEVM_ADD_OR_RESET=no
216+
AC_MSG_RESULT([no])
217+
],[
218+
HAVE_DEVM_ADD_OR_RESET=yes
219+
AC_MSG_RESULT([yes])
220+
AC_DEFINE([WACOM_DEVM_OR_RESET], [], [kernel defines devm_add_action_or_reset from v4.6+])
221+
])
222+
208223
dnl Check which version of the driver we should compile
209224
AC_DEFUN([WCM_EXPLODE], [$(echo "$1" | awk '{split($[0],x,"[[^0-9]]"); printf("%03d%03d%03d\n",x[[1]],x[[2]],x[[3]]);}')])
210225
EXPLODED_VER="WCM_EXPLODE($MODUTS)"

0 commit comments

Comments
 (0)