On Wed, Feb 25, 2026 at 10:02 PM Bjorn Andersson <[email protected]> wrote:

> > Thanks for the explanation. If I’m understanding correctly, what you’re 
> > suggesting is
> > essentially a driver that merges the roles of a virtio_driver and an 
> > rpmsg_driver into a
> > single source file. There may be opportunities for a few function reuse, 
> > but overall it
> > would still result in a fairly distinct codebase.
> >
>
> Most of the non-boilerplate code in gpio-virtio would be impacted by
> differences between rpmsg and virtio. So combining the two
> implementations in a single source file would add complexity to an
> otherwise straightforward driver, only with trivial parts reused.
>
> My expectation is that it will be better to just have two separate
> drivers - but reuse all the design-work done in the gpio-virtio.

I agree with Bjorn.

If there is indeed code to be reused, just create a library
module .c/.o/.h file and export the symbols. modprobe will
bring it in, Kconfig will configure it in if compiled in. One or the
other or both modules can use that. We do this
all over the place.

Yours,
Linus Walleij

Reply via email to