[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150914150155.GA25990@saruman.tx.rr.com>
Date: Mon, 14 Sep 2015 10:01:55 -0500
From: Felipe Balbi <balbi@...com>
To: Peter Senna Tschudin <peter.senna@...il.com>
CC: Felipe Balbi <balbi@...com>,
Alan Stern <stern@...land.harvard.edu>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Masanari Iida <standby24x7@...il.com>, <pmladek@...e.cz>,
<linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: similar files: fusbh200-hcd.c and fotg210-hcd.c
On Sat, Sep 12, 2015 at 03:14:50PM +0200, Peter Senna Tschudin wrote:
> >> Should these files be consolidated? And if so how?
> > if you can find an easy way, that would be a very, very welcome patch.
>
> Is the ideal solution to consolidate both fusbh200-hcd.c and
> fotg210-hcd.c in a single module? If this is the case, how to detect
> at run time which version of the hw is present? Both are registered as
does it matter ? If they work the same way, why does it matter which
one's running?
> platform devices and I could not find an obvious way to detect the
> model at run time. I could successfully load fusbh200-hcd on my fedora
is there a revision register ? Or you may use different platform_device
names with platform_device_id table.
> notebook (hp elitebook 840), and on a VM, even if neither has the hw
> ($ sudo modprobe fusbh200-hcd). The module loads with the warning
> "fusbh200_hcd should always be loaded before uhci_hcd and ohci_hcd,
> not after". On another workstation running ubuntu, I could load both
> modules at the same time, producing the same warning for each module.
> Should the module load if the device is not present?
>
> Other solution for consolidation would be to create a common_code.c,
> keeping both fusbh200-hcd.c and fotg210-hcd.c only with the code that
> differ. Is this better than what is there now?
>
> Other ideas?
just combine them :-p Use platform_device_id to differentiate.
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists