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

From: Mark Brown
Date: Wed Feb 22 2012 - 07:56:01 EST


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.

Applied but...

> +static ssize_t regmap_map_write_file(struct file *file, const char __user *user_buf,
> + size_t count, loff_t *ppos)

...with this wrapped into 80 columns.

> 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.

Attachment: signature.asc
Description: Digital signature