From: Mark Brown Date: Mon, 2 Jun 2014 16:07:39 +0000 (+0100) Subject: Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic... X-Git-Tag: Ubuntu-5.2.0-15.16~13039^2~33^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=522168d178208ff821b9bc37ffcd2442b80f6e6d;p=mirror_ubuntu-eoan-kernel.git Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic/mmio' and 'regmap/topic/rbtree' into regmap-next --- 522168d178208ff821b9bc37ffcd2442b80f6e6d diff --cc drivers/base/regmap/regmap-mmio.c index 902c4fb5c760,1e03e7f8bacb,1e03e7f8bacb,dff32c6b2474,1e03e7f8bacb..04a329a377e9 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c @@@@@@ -61,11 -61,11 -61,11 -61,30 -61,11 +61,30 @@@@@@ static int regmap_mmio_regbits_check(si } } ----static inline void regmap_mmio_count_check(size_t count) ++++static inline void regmap_mmio_count_check(size_t count, u32 offset) { ---- BUG_ON(count % 2 != 0); ++++ BUG_ON(count <= offset); ++ +} ++ + +++ +static inline unsigned int +++ +regmap_mmio_get_offset(const void *reg, size_t reg_size) +++ +{ +++ + switch (reg_size) { +++ + case 1: +++ + return *(u8 *)reg; +++ + case 2: +++ + return *(u16 *)reg; +++ + case 4: +++ + return *(u32 *)reg; +++ +#ifdef CONFIG_64BIT +++ + case 8: +++ + return *(u64 *)reg; +++ +#endif +++ + default: +++ + BUG(); +++ + } + } + static int regmap_mmio_gather_write(void *context, const void *reg, size_t reg_size, const void *val, size_t val_size) @@@@@@ -118,9 -118,9 -118,9 -137,9 -118,9 +137,9 @@@@@@ static int regmap_mmio_write(void *context, const void *data, size_t count) { struct regmap_mmio_context *ctx = context; --- - u32 offset = ctx->reg_bytes + ctx->pad_bytes; +++ + unsigned int offset = ctx->reg_bytes + ctx->pad_bytes; ---- regmap_mmio_count_check(count); ++++ regmap_mmio_count_check(count, offset); return regmap_mmio_gather_write(context, data, ctx->reg_bytes, data + offset, count - offset);