On Feb 3, 2014, at 2:57 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 >>> <whatever>" 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?
I was actually thinking we could have all the respective drivers derive from a mmc_base class, so we'd need only one, which is even simpler... Otherwise, look at how PCI accomplishes this. You just declare it globally, then have each of the MD files reference it. Not sure I like that, but it is fast to implement and nicer than what we have today. And I'm already recursed 5 levels away from my primary goal in 'Yak Shaving' at the moment, or I'd do it... Warner _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"