Re: [PATCH 1/1] regmap: debugfs: Allow writes to cache state settings

From: Mark Brown
Date: Tue Jun 23 2015 - 06:27:13 EST

On Mon, Jun 22, 2015 at 05:10:44PM +0100, Richard Fitzgerald wrote:
> On Mon, Jun 22, 2015 at 04:49:15PM +0100, Mark Brown wrote:

> > Can we not export read/write_file_bool() instead? For the read this
> > seems to be an almost cut'n'paste with slight differences that look
> > like taste changes. For the write path we can just stash the current
> > value in the calling functions instead of cut'n'pasting the code.

> They assume that file->private_data points at the actual bool, and
> it doesn't here, which means temporarily patching it around the call.

Or you could use container_of() in your wrappers for the write path.

Attachment: signature.asc
Description: Digital signature