> > Gregory's SoB is missing, too.> > Ok, hope Gregory is reading this EMails ...
He gave it on the original patch, so you can (and should) reuse it.
> >> + for (i = 0; i < RV3029C2_WATCH_SECTION_LEN; ++i) {> >> + if (regs[i] & zero_mask[i]) /* check if bits are cleared */> >> + return -ENODEV;> >> + }> > > > I haven't checked the datasheet; will this work after a reset when time was> > set before?> > Yes. This function checks, if the not used bits in the registers are set to 0.
Now I see. Ehrm, well, I recognize two other drivers are doing this as well,
but I dunno, calling those functions "validate" is a bit too much. It is more
an educated guess... I tend to think it is better to not give guarantees
instead of just trying to keep them.
> >> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))> >> + return -ENODEV;> > > > As all blocks transferred are < 32, what about using the smbus_block functions?> > Yep, check this.
Cool, thanks for doing that.
Regards,
Wolfram

Hello Wolfram,
Wolfram Sang wrote:
>>> Gregory's SoB is missing, too.>> Ok, hope Gregory is reading this EMails ...> > He gave it on the original patch, so you can (and should) reuse it.
added.
>>>> + for (i = 0; i < RV3029C2_WATCH_SECTION_LEN; ++i) {>>>> + if (regs[i] & zero_mask[i]) /* check if bits are cleared */>>>> + return -ENODEV;>>>> + }>>> I haven't checked the datasheet; will this work after a reset when time was>>> set before?>> Yes. This function checks, if the not used bits in the registers are set to 0.> > Now I see. Ehrm, well, I recognize two other drivers are doing this as well,> but I dunno, calling those functions "validate" is a bit too much. It is more> an educated guess... I tend to think it is better to not give guarantees> instead of just trying to keep them.
Ok, if nobody objects, I remove this "check" ...
>>>> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))>>>> + return -ENODEV;>>> As all blocks transferred are < 32, what about using the smbus_block functions?>> Yep, check this.> > Cool, thanks for doing that.
No problem, thanks for the hint!
I wait for more comments, before sending an updated patch.
bye,
Heiko