From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755411AbbINPCF (ORCPT ); Mon, 14 Sep 2015 11:02:05 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:59056 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755156AbbINPCC (ORCPT ); Mon, 14 Sep 2015 11:02:02 -0400 Date: Mon, 14 Sep 2015 10:01:55 -0500 From: Felipe Balbi To: Peter Senna Tschudin CC: Felipe Balbi , Alan Stern , Sergei Shtylyov , Masanari Iida , , , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman Subject: Re: similar files: fusbh200-hcd.c and fotg210-hcd.c Message-ID: <20150914150155.GA25990@saruman.tx.rr.com> Reply-To: References: <20150908155257.GE25074@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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? >=20 > 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? >=20 > Other ideas? just combine them :-p Use platform_device_id to differentiate. --=20 balbi --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV9uFjAAoJEIaOsuA1yqREdtQP/2oGbCMEbHrGP+P6joo0+ML6 HtRGGE9SMuTCTn7N2aWnOQ77kDE+DB0puOiyqBnpLG3k7hObhPZKju82MIiNh262 zTCwab/E8gZ0urdXrY2VjBnK/d6ZQeOh1nUGQnHaBvsQ3GBC0WuB61iTvQyLGY1H lr8MSM0qpYjWlE/uH0BNXrfOtjMAB8/FJce4t2E1BKr0QPoIqvqyITDJ+Rb+RZ0i Diz6x+9aEERQqc5wJKvmk76ThIQWojLChHsNOlsH725VQEC6CrYVvvw05ZixUl8R fHQNUKm/TZldJC81htjmA0wt1c1W3bhYkkfjn+xGVZJDy3Zx2zuqWNjL6pnfu1y8 8RuVb/PCRXXBdXiD+90msQ/vUwN0ga9In9jBbouqIHIwWoiZAAAFxvW7c1v7K1aY 8BkdfHPD+9bPn29Aboyu6Lfe55lFFNWEElYIOSlKbmItNEPEWMB+7DIBuIdzdM22 ukZHQGRZLbrFrrX8xCsqtgpok6gKrReg/CBhd3pVDW0lOu1pmAqqpJjmtr/v1MCW dYutDBmzcSXEoTVsrPb9AZ0uzo0n9BX40LSTahcDhYFhPEsFkpX3Q4iKMYaofjqE WW+SULxCnq99qncoWMG/sdy2WXcvmHWmlQeWf0y4NE7UnoWqWhcAY+OLY/sPS/mN saKKZFF9lwIp7Ocvg5h3 =iEuA -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g--