[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130611104841.GX1403@sirena.org.uk>
Date: Tue, 11 Jun 2013 11:48:41 +0100
From: Mark Brown <broonie@...nel.org>
To: Srinivas KANDAGATLA <srinivas.kandagatla@...com>
Cc: linux-arm-kernel@...ts.infradead.org,
Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
"David S. Miller" <davem@...emloft.net>,
devicetree-discuss@...ts.ozlabs.org,
Grant Likely <grant.likely@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
John Stultz <john.stultz@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux@....linux.org.uk, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...hat.com>,
Olof Johansson <olof@...om.net>,
Rob Herring <rob.herring@...xeda.com>,
Rob Landley <rob@...dley.net>,
Samuel Ortiz <sameo@...ux.intel.com>,
Stephen Gallimore <stephen.gallimore@...com>,
Stuart Menefy <stuart.menefy@...com>,
Thomas Gleixner <tglx@...utronix.de>,
Tony Prisk <linux@...sktech.co.nz>,
Alexander Shiyan <shc_work@...l.ru>,
Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v2 03/11] regmap: Add regmap_field APIs
On Mon, Jun 10, 2013 at 10:21:58AM +0100, Srinivas KANDAGATLA wrote:
> It is common to access regmap registers at bit level, using
> regmap_update_bits or regmap_read functions, however the end user has to
> take care of a mask or shifting. This becomes overhead when such use
> cases are high. Having a common function to do this is much convenient
> and less error prone.
So this looks basically good. A couple of smallish nits below, if you
could respin I'll apply this on a branch so it can be pulled in as
dependency for the other things that use it.
> + regmap_field_init(rm_field, regmap, reg_field);
> +
> + return rm_field;
> +
> +}
> +EXPORT_SYMBOL_GPL(devm_regmap_field_alloc);
> +/**
> + * regmap_field_alloc(): Allocate and initialise a register field
Needs a blank line between the two functions.
> +#include <linux/device.h>
> +#include <linux/slab.h>
> +static inline void regmap_field_free(struct regmap_field *field)
> +{
> + kfree(field);
> +}
> +static inline void devm_regmap_field_free(struct device *dev,
> + struct regmap_field *field)
> +{
> + devm_kfree(dev, field);
> +}
Probably not worth inlining these, just put them in the code.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists