Re: [linux-usb-devel] compile error when building multiple EHCI host controllers as modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 23 March 2006 2:26 pm, Kumar Gala wrote:

> "ehci-pci.c".  I was wondering if there were an thoughts on how to  
> address this so I can build as a module.

Hmm, there was a patch to fix that for OHCI a while back, I'm not
sure what happened to it.  Maybe the cleaned up version just never
got posted as promised.

The problem is that there need to be two different init (and exit)
section routines for the bus glue:  platform_bus and/or pci_bus.

PCs typically just have PCI; battery-oriented SOCs tend to never
have PCI; and we're now starting to see some non-battery SOCs that
include PCI support as well as integrated USB host support.

The *hci-hcd.c file should be converted to have a single module_init()
and module_exit() routine at the end, looking something like

	static int __init Xhci_init(void)
	{
		int status;

		/* various shared stuff, dump version etc */

		/* SOCs usually use only this path */
		status = Xhci_platform_register();
		if (status < 0)
			return status;

		/* PCs, and a few higher powered SOCs, use this */
		status = Xhci_pci_register();
		if (status < 0)
			Xhci_platform_unregister();
		return status;
	}
	module_init(Xhci_init);

Likewise for module_exit.  The #includes for the platform-specific glue
(including PCI) would define those Xhci_platform_*() routine, and it's
a simple bit of #ifdeffery to make sure there's always at least some
NOP default available for those.

- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux