From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Greg KH <greg@kroah.com>,
Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>, Samuel Oritz <sameo@linux.intel.com>,
Graeme Gregory <gg@slimlogic.co.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] regulator: Convert tps65023 to use regmap API
Date: Sat, 16 Jul 2011 10:47:09 +0900 [thread overview]
Message-ID: <20110716014536.GA17883@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20110715182954.GB2833@ponder.secretlab.ca>
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 :/
next prev parent reply other threads:[~2011-07-16 2:19 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-09 4:49 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-09 4:50 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-09 4:50 ` [PATCH 2/4] regmap: Add I2C bus support Mark Brown
2011-07-09 11:53 ` Wolfram Sang
2011-07-09 14:08 ` Mark Brown
2011-07-09 14:57 ` Wolfram Sang
2011-07-10 2:59 ` Mark Brown
2011-07-10 9:03 ` Wolfram Sang
2011-07-09 4:50 ` [PATCH 3/4] regmap: Add SPI " Mark Brown
2011-07-15 2:53 ` Grant Likely
2011-07-15 4:39 ` Mark Brown
2011-07-15 5:04 ` Grant Likely
2011-07-15 5:09 ` Mark Brown
2011-07-15 9:01 ` Jonathan Cameron
2011-07-15 18:30 ` Grant Likely
2011-07-09 4:50 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-15 2:53 ` Grant Likely
2011-07-15 4:48 ` Mark Brown
2011-07-15 18:29 ` Grant Likely
2011-07-16 1:47 ` Mark Brown [this message]
2011-07-16 2:06 ` Grant Likely
2011-07-16 2:13 ` Mark Brown
2011-07-09 5:44 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Greg KH
2011-07-15 2:53 ` Grant Likely
2011-07-15 3:25 ` Mark Brown
2011-07-15 3:30 ` Grant Likely
-- strict thread matches above, loose matches on Subject: below --
2011-07-15 6:22 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-15 6:23 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-15 6:23 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-15 10:31 ` Jean Delvare
2011-07-15 12:16 ` Mark Brown
2011-07-15 12:58 ` Jean Delvare
2011-07-15 13:10 ` Mark Brown
2011-07-15 13:17 ` Mark Brown
2011-07-17 15:53 ` Jean Delvare
2011-07-18 0:00 ` Grant Likely
2011-07-18 9:44 ` Mark Brown
2011-07-16 2:48 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-16 2:48 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-16 2:48 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-18 10:04 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-18 10:07 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-18 10:07 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110716014536.GA17883@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=dp@opensource.wolfsonmicro.com \
--cc=gg@slimlogic.co.uk \
--cc=grant.likely@secretlab.ca \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox