How to Convert Legacy Kernel Modules for modern Kernels

Greg KH greg at
Fri Jan 21 03:53:06 EST 2022

On Fri, Jan 21, 2022 at 04:21:18PM +0800, Tianrui Wei wrote:
> >> If there're not out of box solutions, is there a way I could view the
> >> API changes in every subsystem clearly? For example, this particular
> >> commit[^1] shows the second return argument is being removed from
> >> ki_complete, and it took a lot of fishing down the lkml to do. Perhaps
> >> there is a simpler way?
> >
> > Use git itself to track the changes in apis.  You can see all changes to
> > a .h file by doing:
> >     git log -p path/to/file
> > and then see where the api got changed.
> This is a really good suggestion, and it's also the way I approach
> recent kernel modules. However some specifically ancient kernel
> modules is rather difficult to use this approach.

We have git history going back to Linux 0.1 so this should work.  If
not, then do the normal 'does it build' test.  APIs are almost always
changed in ways that break the build.

> > It usually isn't that difficult to forward port a driver, but it all
> > depends on the age of the code, and what it actually does.  Do you have
> > a link to the code you wish to drag forward?
> The specific driver I had in mind is a PCIE driver for a Xilinx IP
> block. It's under
> in a zip folder called Everyone
> with a xilinx account could download the folder. Unfortunately its
> header claims it contains confidential information from Xilinx, as
> such I'm a bit wary to post it online.

Please get support from xilix for stuff like this.  You are paying for
it from them, so please take advantage of it.  Especially if they claim
that their code is not GPLv2 compatible, you want them to take that
legal risk, not you :)

greg k-h

More information about the Kernelnewbies mailing list