Re: [RFC PATCH] regmap: mmio: add register clock support

From: Mark Brown
Date: Thu Feb 14 2013 - 06:56:35 EST


On Thu, Feb 14, 2013 at 10:49:14AM +0100, Philipp Zabel wrote:

> Some mmio devices have a dedicated interface clock that needs
> to be enabled to access their registers. This patch optionally
> enables a clock before accessing registers in the regmap_bus
> callbacks.

This is a good feature but a couple of concerns here.

> + if (ctx->clk)
> + clk_prepare_enable(ctx->clk);
> +

This is only going to work if prepare doesn't sleep. That's probably
fine for the use cases we're interested in but doesn't fill me with joy.
The other thing is that we ought to check the return value.

Attachment: signature.asc
Description: Digital signature