Skip to content

Commit 3cb12d6

Browse files
authored
Merge pull request #289 from jeremy90307/master
Allow devicemodel built with Linux v6.11+
2 parents e442916 + e3e1143 commit 3cb12d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/devicemodel.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <linux/kernel.h>
55
#include <linux/module.h>
66
#include <linux/platform_device.h>
7+
#include <linux/version.h>
78

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

2324
return 0;
2425
}
25-
26+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
2627
static int devicemodel_remove(struct platform_device *dev)
28+
#else
29+
static void devicemodel_remove(struct platform_device *dev)
30+
#endif
2731
{
2832
pr_info("devicemodel example removed\n");
2933

3034
/* Your device removal code */
31-
35+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
3236
return 0;
37+
#endif
3338
}
3439

3540
static int devicemodel_suspend(struct device *dev)

0 commit comments

Comments
 (0)