[PATCH 1/4] regulator: tps65910: update type for regmap
Mark Brown
broonie at opensource.wolfsonmicro.com
Thu Apr 19 22:54:43 EST 2012
On Wed, Apr 18, 2012 at 01:19:31PM -0700, Rhyland Klein wrote:
> On Wed, 2012-04-18 at 13:03 -0700, Rhyland Klein wrote:
> > Which interface are you saying is broken? The regmap interface or the
> > one internal to the tps65910 code?
This driver is broken.
> > So to be clear... Your recommendation is to change the tps65910 code to
> > remove the common read/write callbacks and to use regmap directly in
> > each component, and then when using regmap, do use the regmap raw
> > functions instead of the bulkread/write?
> Looking at the code, I would think it makes more sense use regmap_read
> which enforces types since the tps65910 code only ever seems to use
> regmap to access a single register at a time. Do you agree?
Yes, for single register I/O the drivers should just be using the
per-register APIs regmap has if they're using regmap directly. Having
wrappers for this in the header would be fine also, the things that are
really problematic about the current code are the void * usage and the
fact that individual drivers are writing register read/write functions.
If the driver wasn't using void * this bug would've been caught by the
compiler.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120419/2845b509/attachment.sig>
More information about the devicetree-discuss
mailing list