[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110716014536.GA17883@opensource.wolfsonmicro.com>
Date: Sat, 16 Jul 2011 10:47:09 +0900
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Greg KH <greg@...ah.com>,
Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>,
Liam Girdwood <lrg@...com>,
Samuel Oritz <sameo@...ux.intel.com>,
Graeme Gregory <gg@...mlogic.co.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] regulator: Convert tps65023 to use regmap API
On Fri, Jul 15, 2011 at 12:29:54PM -0600, Grant Likely wrote:
> On Fri, Jul 15, 2011 at 01:48:05PM +0900, Mark Brown wrote:
> > Right, the driver is always going to know exactly what bus it registered
> > on but for many drivers we don't really have any bus-specific code once
> > we factor out the register I/O.
> Exactly my point. The only time a global registration list is needed
> is at setup time. Once the regmap structure is initialized, it
> doesn't need to reference the list. I far prefer the simplicity of an
> explicit bus type initialization than the implicit method with the
I'm just not seeing massive complexity here, and I am writing a lot of
multi-bus drivers with bolierplate code. My ideal world would be one
line probe and exit functions for the buses, or better yet a single ops
structure assigned to both buses, as with my user hat on if I'm telling
the API the struct device to use I really shouldn't be having to tell it
what bus the device is on since I just told it that.
> extra indirection code needed to implement it, by my measure, ~60-70
> lines of code.
If you're talking about pure lines of code here then obviously you don't
need to convert terribly many drivers before you end up with a saving
overall.
> Also, making is explicit guarantees that there is no question about
> the i2c or spi module of regmap getting loaded before it gets used.
The bus must obviously be ready for the device to probe in the first
place and the regmap API is static only so it'll always be there. We
just need to load the regmap hooks along with the bus core and we're
fine.
Still, the merge window is getting near so I guess I'll make the change :/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists