Location of files for a new driver

Greg KH greg at kroah.com
Tue May 5 10:20:32 EDT 2020

On Tue, May 05, 2020 at 03:58:28PM +0200, Jacko Dirks wrote:
> Hello,
> I am starting to work on a new driver. I think the actual driver
> (c file) needs to be placed in drivers/staging/subdir (am I 
> correct?).

drivers/staging/ is only for code that needs lots and lots of work to
get into the "real" part of the kernel.  It also requires a TODO file
that lists what is left to do to get it out of that location.

If you can write that TODO list, it's almost always easier to just do
that work yourself and then get the code merged into the real part of
the kernel than to put it into drivers/staging/

> But I also need to edit existing dts and dtsi files and I
> also need to introduce a new overlay. Where do I place those changes and
> new files? 

It all depends on what you are writing.  What exactly does this code do?
That will determine where it goes in the kernel tree.


greg k-h

More information about the Kernelnewbies mailing list