xairy / raw-gadget

USB Raw Gadget — a low-level interface for the Linux USB Gadget subsystem
333 stars 35 forks source link

Replaced call to deprecated function `usb_gadget_probe_driver`. #55

Closed antoniprzybylik closed 7 months ago

antoniprzybylik commented 7 months ago

usb_gadget_probe_driver is deprecated and usb_gadget_register_driver should be used instead, now.

xairy commented 7 months ago

Hi! This change is deliberately patched out to keep the module compatible with older kernels; see here. Thanks!

antoniprzybylik commented 7 months ago

Wouldn't it be better to use macros for choosing fragments of code? Then update.sh would not be necessary.

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0))
        some code
#else
        another code
#endif
xairy commented 7 months ago

I would still keep the update.sh script and apply a compatibility patch on top just as done now. But changing the patch itself to contain KERNEL_VERSION checks sounds good to me.

So please send a pull request if you get around to implementing this. Thanks!