Skip to content

Commit

Permalink
amd/amdkcl: replace kallsyms_lookup_name for 5.7.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
agravgaard committed Jun 15, 2020
1 parent 26b52ab commit 79e8633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/amd/amdkcl/kcl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#include <linux/kallsyms.h>
#include <linux/bug.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && \
LINUX_VERSION_CODE > KERNEL_VERSION(5, 7, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
extern unsigned long (*_kcl_kallsyms_lookup_name)(const char *name);
#endif
static inline unsigned long kcl_kallsyms_lookup_name(const char *name)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && \
LINUX_VERSION_CODE > KERNEL_VERSION(5, 7, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
return _kcl_kallsyms_lookup_name(name);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
return (unsigned long)__symbol_get(name);
#else
return kallsyms_lookup_name(name);
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdkcl/symbols
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SYMS=""

if version_lt 2.6.33 || version_gt 5.7.0; then
if version_lt 2.6.33; then
SYMS+=" kallsyms_lookup_name"
fi

0 comments on commit 79e8633

Please sign in to comment.