Skip to content

Commit 8016001

Browse files
authored
Merge pull request #321 from EricccTaiwan/example-refactor
examples: Refactor device model with version-based split
2 parents 0954458 + 38a991d commit 8016001

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/devicemodel.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,21 @@ static int devicemodel_probe(struct platform_device *dev)
2323

2424
return 0;
2525
}
26+
2627
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
2728
static void devicemodel_remove(struct platform_device *dev)
29+
{
30+
pr_info("devicemodel example removed\n");
31+
/* Your device removal code */
32+
}
2833
#else
2934
static int devicemodel_remove(struct platform_device *dev)
30-
#endif
3135
{
3236
pr_info("devicemodel example removed\n");
33-
3437
/* Your device removal code */
35-
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
3638
return 0;
37-
#endif
3839
}
40+
#endif
3941

4042
static int devicemodel_suspend(struct device *dev)
4143
{

0 commit comments

Comments
 (0)