Skip to content

Commit

Permalink
fix(driver): fix build on linux-6.2
Browse files Browse the repository at this point in the history
Attributes in "struct device*" are now const, so add a matching prototype
for ppm_devnode().

Fixes #918

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
  • Loading branch information
hhoffstaette authored and poiana committed Feb 22, 2023
1 parent 5337398 commit b8ec3e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2662,11 +2662,15 @@ static int get_tracepoint_handles(void)
#endif

#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
static char *ppm_devnode(const struct device *dev, umode_t *mode)
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
static char *ppm_devnode(struct device *dev, umode_t *mode)
#else
static char *ppm_devnode(struct device *dev, mode_t *mode)
#endif
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0) */
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(6, 2, 0) */
{
if (mode) {
*mode = 0400;
Expand Down

0 comments on commit b8ec3e8

Please sign in to comment.