Skip to content
This repository was archived by the owner on Nov 26, 2023. It is now read-only.

Commit 53ce6e3

Browse files
committed
1 parent fe7c53a commit 53ce6e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/apple-ib-als.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <linux/module.h>
3838
#include <linux/platform_device.h>
3939
#include <linux/slab.h>
40+
#include <linux/version.h>
4041

4142
#include "apple-ibridge.h"
4243

@@ -459,8 +460,11 @@ static int appleals_config_iio(struct appleals_device *als_dev)
459460
struct iio_trigger *iio_trig;
460461
struct appleals_device **priv;
461462
int rc;
462-
463+
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
463464
iio_dev = iio_device_alloc(sizeof(als_dev));
465+
#else
466+
iio_dev = iio_device_alloc(&als_dev->hid_dev->dev, sizeof(als_dev));
467+
#endif
464468
if (!iio_dev)
465469
return -ENOMEM;
466470

@@ -469,7 +473,9 @@ static int appleals_config_iio(struct appleals_device *als_dev)
469473

470474
iio_dev->channels = appleals_channels;
471475
iio_dev->num_channels = ARRAY_SIZE(appleals_channels);
476+
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
472477
iio_dev->dev.parent = &als_dev->hid_dev->dev;
478+
#endif
473479
iio_dev->info = &appleals_info;
474480
iio_dev->name = "als";
475481
iio_dev->modes = INDIO_DIRECT_MODE;

0 commit comments

Comments
 (0)