fix build for < 6.2 again

This commit is contained in:
anna 2023-02-28 14:22:31 +01:00
parent b38189d3c4
commit 806d91be53
Signed by: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -8,6 +8,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/version.h>
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("fef <owo@fef.moe>"); MODULE_AUTHOR("fef <owo@fef.moe>");
@ -67,7 +68,11 @@ static const struct file_operations keymash_fops = {
.read = keymash_read, .read = keymash_read,
}; };
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
static char *keymash_devnode(struct device *dev, umode_t *mode)
#else
static char *keymash_devnode(const struct device *dev, umode_t *mode) static char *keymash_devnode(const struct device *dev, umode_t *mode)
#endif
{ {
if (mode) if (mode)
*mode = 0444; *mode = 0444;