From owner-svn-src-all@FreeBSD.ORG Tue Feb 4 19:09:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6268975A for ; Tue, 4 Feb 2014 19:09:02 +0000 (UTC) Received: from mail-oa0-f42.google.com (mail-oa0-f42.google.com [209.85.219.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F92C1E16 for ; Tue, 4 Feb 2014 19:09:01 +0000 (UTC) Received: by mail-oa0-f42.google.com with SMTP id i7so10493321oag.29 for ; Tue, 04 Feb 2014 11:09:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=+T+RYtGHd4kU1mE0BAEbmHYi4HtWibe9LMAdvjFEh/Y=; b=Tyj4f5tDoCcW7wXUnT40pe5ViMvR6qbrojxHtuUDEtvCquZ2YbAsL35XHr3sxAAAAI +2J8eqJqaFQ2hKh9RlxrEmXHJkIgnHmqtlVRadEgFQ3B+GN3q7baZI/x3m2vt4Vf6zMQ k3kvPCEX/denFuM4z9/KFFNgEuBOffEJQ+gmIapYrOXErln/FvrQGMQtsLuIPp1Jzbyj xd5EQDoBK2oQ9/M3aIYnGtsQCobgWZWaILeyXU01vlbJir8ZifgEFzIwNsrPlI436xEt 8kmQTV4ZTwUYcMkln3p00nSO9/ShUalBh/JuwbsqxuBICeDklmjOrglvHx8CN+TyODAl nw9w== X-Gm-Message-State: ALoCoQmJBDZHgHTp37BrQSkAD269D+vjcTNu1Sw6cQtn9mL4SZbNRTNiHdLr6FGGm3ustFeGktIn X-Received: by 10.182.149.168 with SMTP id ub8mr2873254obb.74.1391540456227; Tue, 04 Feb 2014 11:00:56 -0800 (PST) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id g4sm43151503obe.5.2014.02.04.11.00.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 11:00:55 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r261424 - head/sys/dev/mmc Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1391464672.13026.105.camel@revolution.hippie.lan> Date: Tue, 4 Feb 2014 12:00:54 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402030256.s132uNjk086555@svn.freebsd.org> <20140203170330.GC89104@funkthat.com> <1391458059.13026.96.camel@revolution.hippie.lan> <3325243.MZLnPn2Brt@ralph.baldwin.cx> <1391464672.13026.105.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1085) Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, John Baldwin 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 19:09:02 -0000 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 >>>>>=20 >>>>> Log: >>>>> Sort the list. >>>>>=20 >>>>> Modified: >>>>> head/sys/dev/mmc/mmc.c >>>>>=20 >>>>> Modified: head/sys/dev/mmc/mmc.c >>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>> =3D=3D=3D=3D=3D=3D --- 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 =3D { >>>>>=20 >>>>> }; >>>>> static devclass_t mmc_devclass; >>>>>=20 >>>>> -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, = NULL); >>>>> DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, = NULL); >>>>>=20 >>>>> +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); >>>>> + >>>>=20 >>>> 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? >>>=20 >>> 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). >>=20 >> 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. >>=20 >> (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.) >>=20 >> Too bad cpp doesn't support macro overloading, then we could make = that >> change seamlessly. :) >>=20 >=20 > Interesting, I had no idea. Do we have examples of doing it this = other > way in the tree now?=20 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=