Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions 4.18/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2942,7 +2942,9 @@
wacom_release_resources(wacom);
}

#ifndef HAVE_PM_PTR
#ifdef CONFIG_PM
#endif
static int wacom_resume(struct hid_device *hdev)
{
struct wacom *wacom = hid_get_drvdata(hdev);
Expand All @@ -2962,18 +2964,25 @@
{
return wacom_resume(hdev);
}
#ifndef HAVE_PM_PTR
#endif /* CONFIG_PM */
#endif

static struct hid_driver wacom_driver = {
.name = "wacom",
.id_table = wacom_ids,
.probe = wacom_probe,
.remove = wacom_remove,
.report = wacom_wac_report,
#ifdef HAVE_PM_PTR
.resume = pm_ptr(wacom_resume),
.reset_resume = pm_ptr(wacom_reset_resume),
#else
#ifdef CONFIG_PM
.resume = wacom_resume,
.reset_resume = wacom_reset_resume,
#endif
#endif

Check failure on line 2985 in 4.18/wacom_sys.c

View workflow job for this annotation

GitHub Actions / checkpatch

ERROR: trailing whitespace
.raw_event = wacom_raw_event,
};
module_hid_driver(wacom_driver);
Expand Down
18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,24 @@ WACOM_LINUX_TRY_COMPILE([
AC_MSG_RESULT([no])
])

dnl Check if pm_ptr has been added to pm.h or
dnl not. This is the case in Linux 5.9 and later.
AC_MSG_CHECKING(pm_ptr)
WACOM_LINUX_TRY_COMPILE([
#include <linux/pm.h>
#ifndef pm_ptr
#error "pm_ptr is not defined"
#endif
],[
],[
HAVE_PM_PTR=yes
AC_MSG_RESULT([yes])
AC_DEFINE([WACOM_PM_PTR], [], [kernel defines pm_ptr from v5.9])
],[
HAVE_PM_PTR=no
AC_MSG_RESULT([no])
])

dnl Check which version of the driver we should compile
AC_DEFUN([WCM_EXPLODE], [$(echo "$1" | awk '{split($[0],x,"[[^0-9]]"); printf("%03d%03d%03d\n",x[[1]],x[[2]],x[[3]]);}')])
EXPLODED_VER="WCM_EXPLODE($MODUTS)"
Expand Down
Loading