Re: [PATCH 2/3] regmap: Add support for writing to regmap`registers'

From: Dimitris Papastamos
Date: Wed Feb 22 2012 - 08:57:12 EST


On Wed, Feb 22, 2012 at 12:55:52PM +0000, Mark Brown wrote:
> On Wed, Feb 22, 2012 at 12:43:50PM +0000, Dimitris Papastamos wrote:
> > To enable writing to the regmap `registers' file, users will
> > need to modify the source directly and #define REGMAP_ALLOW_WRITE_DEBUGFS.
> > The reason for this is that it is dangerous to expose this
> > functionality in general where clients could potentially be PMICs.
> >
> > static const struct file_operations regmap_map_fops = {
> > .open = regmap_open_file,
> > .read = regmap_map_read_file,
> > +#ifdef REGMAP_ALLOW_WRITE_DEBUGFS
> > + .write = regmap_map_write_file,
> > +#endif
>
> It's also a bit more idiomatic to have an #else #define function NULL in
> the main ifdef for stuff like this; I'll fix that up as well.

Oops yea, that makes sense.

Thanks,
Dimitris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/