Re: [PATCH] regmap : make lock/unlock functions customizable.

Mark Brown
2012-10-12T06:26:26Z

On Mon, Oct 01, 2012 at 11:31:04PM +0200, ciminaghi@gnudd.com wrote:
> From: Davide Ciminaghi <ciminaghi@gnudd.com>
>
> It is sometimes convenient for a regmap user to override the standard
> regmap lock/unlock functions with custom functions.

This looks good overall but...

> -static void regmap_lock_mutex(struct regmap *map)
> +static void regmap_lock_mutex(void *__map)
> {
> + struct regmap *map = (struct regmap *)__map;
> mutex_lock(&map->mutex);

...you should never need to cast away from or to void, if you do there's
a bug somewhere.