Skip to content

Commit

Permalink
Merge remote-tracking branches 'regmap/fix/doc' and 'regmap/fix/mmio'…
Browse files Browse the repository at this point in the history
… into regmap-linus
  • Loading branch information
Mark Brown committed Nov 26, 2013
3 parents a46b6e7 + 0093380 + 6b8e090 commit 652787a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions drivers/base/regmap/regmap-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int regmap_mmio_gather_write(void *context,

BUG_ON(reg_size != 4);

if (ctx->clk) {
if (!IS_ERR(ctx->clk)) {
ret = clk_enable(ctx->clk);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -73,7 +73,7 @@ static int regmap_mmio_gather_write(void *context,
offset += ctx->val_bytes;
}

if (ctx->clk)
if (!IS_ERR(ctx->clk))
clk_disable(ctx->clk);

return 0;
Expand All @@ -96,7 +96,7 @@ static int regmap_mmio_read(void *context,

BUG_ON(reg_size != 4);

if (ctx->clk) {
if (!IS_ERR(ctx->clk)) {
ret = clk_enable(ctx->clk);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -129,7 +129,7 @@ static int regmap_mmio_read(void *context,
offset += ctx->val_bytes;
}

if (ctx->clk)
if (!IS_ERR(ctx->clk))
clk_disable(ctx->clk);

return 0;
Expand All @@ -139,7 +139,7 @@ static void regmap_mmio_free_context(void *context)
{
struct regmap_mmio_context *ctx = context;

if (ctx->clk) {
if (!IS_ERR(ctx->clk)) {
clk_unprepare(ctx->clk);
clk_put(ctx->clk);
}
Expand Down Expand Up @@ -209,6 +209,7 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,

ctx->regs = regs;
ctx->val_bytes = config->val_bits / 8;
ctx->clk = ERR_PTR(-ENODEV);

if (clk_id == NULL)
return ctx;
Expand Down
6 changes: 3 additions & 3 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
/**
* regmap_read(): Read a value from a single register
*
* @map: Register map to write to
* @map: Register map to read from
* @reg: Register to be read from
* @val: Pointer to store read value
*
Expand All @@ -1770,7 +1770,7 @@ EXPORT_SYMBOL_GPL(regmap_read);
/**
* regmap_raw_read(): Read raw data from the device
*
* @map: Register map to write to
* @map: Register map to read from
* @reg: First register to be read from
* @val: Pointer to store read value
* @val_len: Size of data to read
Expand Down Expand Up @@ -1882,7 +1882,7 @@ EXPORT_SYMBOL_GPL(regmap_fields_read);
/**
* regmap_bulk_read(): Read multiple registers from the device
*
* @map: Register map to write to
* @map: Register map to read from
* @reg: First register to be read from
* @val: Pointer to store read value, in native register size for device
* @val_count: Number of registers to read
Expand Down

0 comments on commit 652787a

Please sign in to comment.