Jiri Slaby wrote:
> On 5/24/07, Markus Rechberger <mrechberger@xxxxxxxxx> wrote:
>> On 5/24/07, Jiri Slaby <jirislaby@xxxxxxxxx> wrote:
> [...]
>> > +static int stk1125_camera_asleep(struct stk11xx *dev)
>> > +{
>> > + int value;
>> > +
>> > + stk11xx_read_registry(dev, 0x0104, &value);
>> > + stk11xx_read_registry(dev, 0x0105, &value);
>> > + stk11xx_read_registry(dev, 0x0106, &value);
>> > +
>>
>> why do you read these values (this is also something in the ongoing
>> code I see, the read value just gets overwritten all the time)?
>
> Well, as I tested, reads are neccesary, otherwise it doesn't work. And
> when they are needed, you need to read the value to some place in
> memory -- the &value.
Perhaps a few comments are warranted here and there about why some of
those less obvious things are done.
Or do it as more or less self-documenting code like
static inline void
stk11xx_unjam_registry(struct stk11xx *dev, u16 index)
{
int dummy;
stk11xx_read_registry(dev, index, &dummy);
}