lkml.org 
[lkml]   [2021]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 2/3] misc/pvpanic: add PCI driver
On Fri, Feb 12, 2021 at 11:18 AM Greg KH <gregkh@linuxfoundation.org> wrote:
le
> > @@ -1,2 +1,4 @@
> > obj-$(CONFIG_PVPANIC_MMIO) += pvpanic-mmio.o
> > pvpanic-mmio-objs := pvpanic-common.o mmio.o
> > +obj-$(CONFIG_PVPANIC_PCI) += pvpanic-pci.o
> > +pvpanic-pci-objs := pvpanic-common.o pci.o
>
> So you now have the pvpanic-common.o file linked into both modules at
> the same time? What happens if they are both loaded?
>
> This feels really broken...

Loading them as two modules should work, but this will probably lead to
a link failure if one of the two drivers is built-in and the other one is
a loadable module.

The usual way to fix this is to make the common part a separate module
with exported symbols for the probe/release functions and built
based on CONFIG_PVPANIC, which then needs to be a tristate
symbol again.

Arnd

\
 
 \ /
  Last update: 2021-02-12 11:27    [W:0.045 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site