From owner-svn-src-all@FreeBSD.ORG Tue Feb 4 00:09:40 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 DC7C828C; Tue, 4 Feb 2014 00:09:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE12116F3; Tue, 4 Feb 2014 00:09:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A844FB94B; Mon, 3 Feb 2014 19:09:38 -0500 (EST) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r261424 - head/sys/dev/mmc Date: Mon, 03 Feb 2014 18:54:24 -0500 Message-ID: <10243645.AuEuZPO9GG@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <1391464672.13026.105.camel@revolution.hippie.lan> References: <201402030256.s132uNjk086555@svn.freebsd.org> <3325243.MZLnPn2Brt@ralph.baldwin.cx> <1391464672.13026.105.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 03 Feb 2014 19:09:38 -0500 (EST) 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: Tue, 04 Feb 2014 00:09:40 -0000 On Monday, February 03, 2014 02:57:52 PM Ian Lepore wrote: > 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? Search for smbus_driver. -- John Baldwin