Skip to content

Commit

Permalink
Merge pull request #289 from jeremy90307/master
Browse files Browse the repository at this point in the history
Allow devicemodel built with Linux v6.11+
  • Loading branch information
jserv authored Dec 12, 2024
2 parents e442916 + e3e1143 commit 3cb12d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/devicemodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/version.h>

struct devicemodel_data {
char *greeting;
Expand All @@ -22,14 +23,18 @@ static int devicemodel_probe(struct platform_device *dev)

return 0;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
static int devicemodel_remove(struct platform_device *dev)
#else
static void devicemodel_remove(struct platform_device *dev)
#endif
{
pr_info("devicemodel example removed\n");

/* Your device removal code */

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
return 0;
#endif
}

static int devicemodel_suspend(struct device *dev)
Expand Down

0 comments on commit 3cb12d6

Please sign in to comment.