public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-usb-devel@lists.sourceforge.net
Cc: Kumar Gala <galak@kernel.crashing.org>, Greg KH <gregkh@suse.de>,
	LKML mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [linux-usb-devel] compile error when building multiple EHCI host controllers as modules
Date: Thu, 23 Mar 2006 22:33:21 -0800	[thread overview]
Message-ID: <200603232233.22422.david-b@pacbell.net> (raw)
In-Reply-To: <25E2BA7D-378B-45B0-995C-201A68432D5C@kernel.crashing.org>

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

  reply	other threads:[~2006-03-24  6:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23 22:26 compile error when building multiple EHCI host controllers as modules Kumar Gala
2006-03-24  6:33 ` David Brownell [this message]
2006-03-24 16:59   ` [linux-usb-devel] " Kumar Gala
2006-03-24 20:32     ` Kumar Gala
2006-03-28 16:18       ` Kumar Gala
2006-03-28 17:51       ` Matthieu CASTET
2006-04-04  2:48       ` [linux-usb-devel] " David Brownell
2006-04-04  4:23         ` Kumar Gala
2006-04-05 17:32           ` Kumar Gala
2006-04-10 19:11             ` David Brownell
2006-04-10 19:16               ` Kumar Gala
2006-04-11 15:07                 ` [PATCH] usb: allow multiple types of EHCI controllers to be built " Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603232233.22422.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=galak@kernel.crashing.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox