From owner-svn-src-all@FreeBSD.ORG Mon Feb 3 21:57:58 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F60E5B8; Mon, 3 Feb 2014 21:57:58 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA7C18CD; Mon, 3 Feb 2014 21:57:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WARWe-000DmY-GM; Mon, 03 Feb 2014 21:57:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s13Lvqge063533; Mon, 3 Feb 2014 14:57:52 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/Ue6Qm8GA/4slyBpsOdInI Subject: Re: svn commit: r261424 - head/sys/dev/mmc From: Ian Lepore To: John Baldwin In-Reply-To: <3325243.MZLnPn2Brt@ralph.baldwin.cx> References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> <1391458059.13026.96.camel@revolution.hippie.lan> <3325243.MZLnPn2Brt@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" Date: Mon, 03 Feb 2014 14:57:52 -0700 Message-ID: <1391464672.13026.105.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 21:57:58 -0000 On Mon, 2014-02-03 at 16:33 -0500, John Baldwin wrote: > On Monday, February 03, 2014 01:07:39 PM Ian Lepore wrote: > > On Mon, 2014-02-03 at 09:03 -0800, John-Mark Gurney wrote: > > > Ian Lepore wrote this message on Mon, Feb 03, 2014 at 02:56 +0000: > > > > Author: ian > > > > Date: Mon Feb 3 02:56:23 2014 > > > > New Revision: 261424 > > > > URL: http://svnweb.freebsd.org/changeset/base/261424 > > > > > > > > Log: > > > > Sort the list. > > > > > > > > Modified: > > > > head/sys/dev/mmc/mmc.c > > > > > > > > Modified: head/sys/dev/mmc/mmc.c > > > > ======================================================================== > > > > ====== --- head/sys/dev/mmc/mmc.c Mon Feb 3 02:52:07 2014 (r261423) > > > > +++ head/sys/dev/mmc/mmc.c Mon Feb 3 02:56:23 2014 (r261424) > > > > @@ -1756,10 +1756,11 @@ static driver_t mmc_driver = { > > > > > > > > }; > > > > static devclass_t mmc_devclass; > > > > > > > > -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); > > > > DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); > > > > > > > > +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); > > > > +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); > > > > +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); > > > > + > > > > > > Is there a reason we don't make mmc_driver/mmc_devclass global and put > > > all of these defines in their respective file instead of poluting an MI > > > file w/ MD info? > > > > I don't think that's an option. Part of what that macro does is create > > metadata that says "this module contains a driver that is a child of bus > > " and I think for that to work right, it has to be in the > > module itself, not elsewhere (at least in the .ko case; maybe it doesn't > > matter when it's compiled into the kernel). > > No, it can be anywhere. It's not voodoo magic, it's just a struct and a > SYSINIT. John-Mark's suggestion is correct (and I thought the same thing > when I saw this commit). You just have to make mmc_driver global. You > should make mmc_devclass as well for now. > > (Side note: the devclass argument to DRIVER_MODULE() is useless in 99.9% > of the cases and should be axed entirely. The very few drivers that want > to find their devclass can use devclass_find() at runtime instead.) > > Too bad cpp doesn't support macro overloading, then we could make that > change seamlessly. :) > Interesting, I had no idea. Do we have examples of doing it this other way in the tree now? -- Ian