Re: [PATCH 1/8] regmap: Add generic non-memory mapped register accessAPI

From: Lars-Peter Clausen
Date: Wed Jun 22 2011 - 15:04:43 EST


On 06/22/2011 08:45 PM, Mark Brown wrote:
> [...]
> +
> +static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
> + unsigned int val_len)
> +{
> + u8 *u8 = map->work_buf;
> + int ret;
> +
> + map->format.format_reg(map->work_buf, reg);
> +
> + /*
> + * Some buses flag reads by setting the high bits in the
> + * register addresss; since it's always the high bits for all
> + * current formats we can do this here rather than in
> + * formatting. This may break if we get interesting formats.
> + */
> + if (map->bus->read_flag_bit)
> + u8[0] |= 1 << map->bus->read_flag_bit;

Should be 1 << (map->bus->read_flag_bit - 1)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/