How do override built-in driver?

Hello.
I spent a lot of time to solving the problem.
I have default kernel config, that I can do:
make -j14 kernel_menuconfig
Regarding current configuration I get the needed driver sources, downloaded from somewhere of Internet. In my case I get for example drivers/net/phy/mediatek/* in build_dir.
Ok, but I faced with task, that I want to modify this driver, simply overwrite 'default' drivers/net/phy/mediatek/*during kernel_menuconfig process.
How can I do that? I tried place modified mediatek driver source in files-6.6 (Openwrt-24 is used), hoping that the original source code will be overwritten. But then the making process starts be angry ("phy/mediatek/*" already exists).
Like this (error occurs, until I delete my modified driver):

How can I overwrite the linux/drivers/net/phy/mediatek/* default code with my modified version outside (just not using patches)?
Thanks.

That is not so easy, looks like you trying other ethernet or wireless driver. you need make sure that all this is up to date with kernel that you are using. If all is uptodate, try replace the folder mediatek in target.

Thanks.
Seems I found a nice solution.
Maybe it will be useful for others.
So, at first I deleted all patches related to this driver (because I modified already latest patched source code - hence don't need patches). Deleting all related patches is necessary for excluding git applying errors.
The next - place modified driver to files directory instead of files-6.6 like I did at first:


Profit.!
Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.