Replace fsl-uart with a new driver version

I modified the fsl-lpuart driver to handle my own serial protocol. I can build a kernel module, remove the existing /dev/ttyLP0 device and try to load the new ttyLP0 Driver on the fly to test the modification.
But I get an error:

insmod fsl-lpuart.ko
insmod: ERROR_could not insert module fsl_lpuart.ko: Invalid Parameters

Whats wrong?

And how exactly did you go about disabling the built-in lpuart driver? How exactly did you deploy updated kernel and matching modules? Along those lines?

I don’t update the kernel,I am only remove the device node (rm /dev/ttyLP0) in my running Linux.

In the first step I only want to test the modifications. For this I build the fsl-uart Driver as a kernel module and try to load this new module (insmod).
In a secound step I will replaced the build-in driver with the new version.

Is there a other way, to test and update the fsl-uart driver?

How did you compile the kernel module?

I followed the articel Build U-Boot and Linux Kernel from Source and fit the colibri-vf-defconfig

CONFIG_SERIAL_FSL_LPUART=m (instead of y)

The result fsl_lpuart.ko I copied to the target board andtry to insert with insmod.

Have you an idear to replace the build-in driver?

But you deployed the binary Linux kernel image as well? You may not separately deploy a Linux kernel module which does not match resp. Linux kernel image.

Okay, so it is possible to test the new driver - thank you.

But how can update a running System with a build in lpuart with this new driver?
Only with a kernel update?

No, you also need to update the device tree bindings as explained here.